Cycling through webbrowser tabs with autokey - linux

I am trying to make a macro that will cycle through and update browser tabs when hitting 'F10'.
Currently it only updates the page I'm currently on, it doesn't cycle through them, I tried googling for it but all the answers were for 'AutoHotKey'. So I looked at the documentation for 'AutoKey' and tried to convert a 'AutoHotKey' script to 'AutoKey' (python) but it doesn't work and I have no idea why.
Here's the script
keyboard.send_keys("< f5>")
keyboard.press_key("< ctrl>")
keyboard.send_keys("< tab>")
keyboard.release_key("< ctrl>")
replacing lines 2 -> 4 with just a "keyboard.press_key("< ctrl>" + "< tab>") doesn't work (I'm not quite sure if it's ("< ctrl> + < tab>") instead, but none works, sadly)
(Please bare in mind that the spaces in front of the "keycodes" are so that Stackoverflow will show them)
Thank you all in advance!!!

I asked in the Google group of AutoKey and they came up with this:
keyboard.send_keys("<f5><ctrl>+<tab>")
And that's all you need, it works flawlessly.
I would later change the 'f5' to 'enter' instead and it never skips any browser tab, it's awesome!
Thank you all for your time!

It strangely worked only the other way around for me, but I think that might still suite your task:
keyboard.press_key("<ctrl>")
keyboard.press_key("<tab>")
time.sleep(0.3)
keyboard.release_key("<ctrl>")
keyboard.release_key("<tab>")
keyboard.send_key("<f5>")
I hope this helps.

Related

Godot Text Edit Node not wrapping

Working on an app that is quite UI intensive in Godot and it seems the wrap_lines option isn't working on the text edit nodes. it still scrolls horizontally as I type or if I set text it just does one long line. Is there a second option I need to change in the node
I have a similar circumstance to your problem with my app and did my own custom solution. However, I am OK with just limiting the number of characters instead of wrapping the lines. My solution only covers limiting the line up to a certain number of characters. This is what I have for my solution:
func _on_TextArea1_text_changed():
var temp = $TextArea1.text
var maxTextSize = 9
if temp.length() > maxTextSize:
$TextArea1.text = temp.substr(0,maxTextSize)
Limitation: If I try to concatenate '\n' I get "Stack Overflow (Stack Size:1024)".
Resource: See https://docs.godotengine.org/en/stable/classes/class_textedit.html
Hope this helps.
Documenting how I fixed wrapping on my TextEdit:
The text property of your TextEdit node must be set after setting wrap_enabled to true. If you set text before, it will not be wrapped.
Took me hours to figure out what was going wrong. Extremely frustrating... Hope this saves someone else from the same.

Create a program that asks the user for a string and then prints the string in upper case

EDIT: I tried the code lines in the link to other questions that were similar, however the programs did not execute correctly
I am a full-on noob trying to complete some free online resources for self improvement and learning. I am using University of Waterloo's 'Python from scratch' and CS circles course I have tried to answer this question and cannot seem to:
Write a program that asks the user for a string and then prints the string in upper case.
I have tried:
print (str(input()).upper)
AS WELL AS
text = input()
print (text.upper)
AND
print(input().upper())
all programs run, but dont have correct output so I dont know what I am missing here. It's likely obvious and I may feel foolish
I would love to learn and move on, thanks for any assistance!
this is 'Python from scratch' 2.11 problem 'g' (7th problem in set)
You were very close, the following works:
input.upper()
so, print(input.upper())
should work for you.
text=input()
print(text.upper())
print(input().upper())
This should have worked for you in Python 3.x

Mediawiki/wikipedia text format issue

so i got an issue with text formatting and i have no idea how this problem is called or what i should search after, so i thought i try to explain it here.
It's literally nothing dramatic or should take long, i simply want to write stuff like
''italic'' or '''bold'''
without that it actually gets italic or bold... i literally want
''italic''
to be displayed. I've also tried to use code blocks but even within the blocks it writes italic then.. i'm sure there is a <..> command but i simply can not find it
Does anyone know?
try this:
<nowiki>''italic''</nowiki>

Why doesn't the kitten example in the Chrome extension development tutorial load any images?

In the Getting Started page, we're promised kittenish goodness from Flickr. Putting the extension together according to the instructions, no kittenish goodness materializes. Instead, the popup window shows a small blank rectangular bar, devoid of anything fuzzy or cute.
Why?
(I'm asking this question with the intent to answer it, because I couldn't find any other way to report the mistake.)
As on 18-Jun-2014, the fix mentioned by Emerson seems to be taken care of in the sample downloads.
If you are still not able to see the images in the popup, you should consider applying for a Flickr API Key
And replace the existing key with the key that you generated in line number 25 of poupup.js file.
There's a bug in the popup.js file on line 40. The reference to kittensOnFlickr_ should be searchOnFlickr_ instead. Fix and reload, and tada, kitteh.
8/1/2014 - The code on line has indeed been fixed, but this tutorial still wouldn't work for me until I pasted my own API key.
HOWEVER
Make sure you don't remove the trailing ampersand (the &) at the end of the pasted api key. The ampersand needs to be there or your code still won't work!

CKEditor and Font Color saved but not working

I've just installed CKEditor and call it with JS tag.
When I save the text, all the font attributes (indentation, space, size, decoration,etc.) are correctly saved .
The problem is that when I want to edit the data, with CKEditor, all these attributes are well loaded but the COLOR even if, in the example below, it's set to "BLUE"!
Which is very bizarre because when I can see the color style property in my database:
<h3 style=\"\\"color:blue\\"\">
<strong>aulne </strong>kjhqsdf <span style=\"\\"color:#008000;\\"\"><u>kjhkjsdfh </u></span>j'<span style=\"\\"\\\\"\\\\"\\"\"><em>espère </em></span><span style=\"\\"\\\\"\\\\"\\"\">bien<sup>2</sup></span></h3>
I found this old bug post http://dev.fckeditor.net/ticket/116
where no solution is found.
Thank very much,
regards.
I found the problem:
on the php side, before inserting, I was using the "addslash" function I forgot to remove.
Thanks again.
It stopped working when I commented out the stripslashes from the php code. So I was doing the opposite and not stripping the slashes. Once I read the other answer I thought dah, I commented the following out yesterday. Now works fine! Certain PHP modes like safe mode will generate extra slashes to lessen hack attempts so moving code from servers with different modes can cause issues. So this answer is the same but opposite reason. My server is in safe mode so it automatically adds the slashes and I must remove them.
$a10 = stripslashes($a10);

Resources