I have the following in .screenrc
# I want to use Vim's navigation keys
bind h focus down
bind t focus up
I would like to be able to move by Ctrl-A t to a next window, while by `Ctrl-A h to the previous window.
However, the above mappings do not work anymore for me.
How can you move between windows in Screen?
bind h prev
bind t next
If you start screen then type Ctrl-A ?, you'll see the help page, which lists next [n] and prev [p]. I believe that binding to next and prev instead of focus will do what you want.
Related
I need to be able to open roughly 10 URLs in Safari and then rotate through them, pausing on each for about 15 seconds. I'd also like the Safari window to be maximized.
I tried this with a simple Javascript, but it causes the windows to refresh every time and that's distracting. So, I think AppleScript with Safari would be a "cleaner" approach
Here's what I've started with:
tell application "Safari"
activate
tell window 1
make new tab with properties {URL:"http://news.yahoo.com"}
make new tab with properties {URL:"http://news.google.com"}
make new tab with properties {URL:"http://www.macintouch.com"}
set current tab to tab 1
set numTabs to number of tabs
end tell
activate
tell window 1
repeat with j from 1 to (count of tabs of window 1) by 1
set current tab to j
activate
delay 5
end repeat
end tell
end tell
This AppleScript code works for me using the latest version of macOS Mojave.
Be sure to fill in the remaining 7 URL's. I think this following code achieves what you are looking for.
tell application "Safari"
activate
if not (exists of window 1) then make new document
tell window 1
set startingTabForRotating to make new tab with properties {URL:"http://news.yahoo.com"} -- URL 1
make new tab with properties {URL:"http://news.google.com"} -- URL 2
--make new tab with properties {URL:"something.com"}
--make new tab with properties {URL:"something.com"}
--make new tab with properties {URL:"something.com"}
--make new tab with properties {URL:"something.com"}
--make new tab with properties {URL:"something.com"}
--make new tab with properties {URL:"something.com"}
--make new tab with properties {URL:"something.com"}
set endingTabForRotating to make new tab with properties {URL:"http://www.macintouch.com"} -- URL 10
set current tab to startingTabForRotating
delay 1
tell application "System Events"
if exists of UI element 3 of window 1 of application process "Safari" then
click UI element 3 of window 1 of application process "Safari" -- Maximizes Safari
end if
end tell
repeat until current tab is endingTabForRotating
delay 15
set current tab to tab ((index of current tab) + 1)
end repeat
end tell
end tell
I've taken a slightly different approach to #wch1zpink. In the script below, you can edit and add to the property URLs, which will define what tabs to open whilst keeping them collected at the top of the script and separate from the main body of the code. You can supply nonsense URLs if you wish, as these are dealt with gracefully by the script.
I've also elected to maximise the window rather than go fullscreen, but if you prefer fullscreen, then this is easily done and I've included a snippet at the end to demonstrate a clean way to achieve this.
property URLs : {"https://google.com", ¬
"https://dropbox.com", ¬
"https://imdb.com", ¬
"https://bbc.co.uk", ¬
"foobar blah blah", ¬
"https://disney.com"}
property errorPage : "safari-resource:/ErrorPage.html"
property time : 15 -- time (seconds) between tab switches
tell application "System Events" to set screenSize to ¬
the size of scroll area 1 of process "Finder"
tell application "Safari"
make new document with properties {URL:the first item in the URLs}
tell the front window
set W to it
repeat with URL in the rest of the URLs
make new tab with properties {URL:URL}
end repeat
set the bounds to {0, 0} & the screenSize
activate
tell (a reference to the current tab) to repeat
delay my time
if not (W exists) then return
set N to the number of tabs in W
try
set contents to tab (index mod N + 1) in W
end try
if its URL = errorPage then close
end repeat
end tell
end tell
The other property you can set is time, which defines how long (in seconds) to pause on each tab, presently set to 15 seconds. The tabs rotate in turn, but do so on a continuous loop until you close the window. Any tabs with nonsense URLs are immediately closed just before coming into focus, so the transition to the next sensible tab is actually seamless and you won't notice the closures.
You can still open new tabs as you please (within the 15-second window), and you can switch to whichever tab you desire manually. The progression will continue from whichever tab you select acting as the new starting point.
Fullscreen
Currently, the script sets the size of the window to the maximum area available on your screen which, in modern versions of macOS, should take into account the menu bar and dock without obscuring them.
If you prefer a fullscreen mode, then you would replace this line:
set the bounds to {0, 0} & the screenSize
with this:
tell application "System Events" to set value of attribute ¬
"AXFullScreen" of front window of process "Safari" to true
Strictly speaking, you ought to try and sit this line outside of the tell application "Safari" block, by splitting the Safari block into two; coming out of the first block to enact the fullscreen mode; then re-entering the second block. But Safari won't die if you don't do this, so a simple cut-and-paste that exchanges one line for the other will suffice, as long as you appreciate that this would be considered lazy and poor form.
I have a problem in scanning a drop-down menu which disappears upon opening the xScan. I need to get the module id of the dropdown menu to verify some test steps.
Do you have any solution with this if it is not really possible to get the module id of the dropdown menu?
Open developer tools in your browser of choice (F12), navigate to the console and input the following code:
var fulldoc='';
var scrollX=0;
var scrollY=0;
document.addEventListener("keydown",function(event){
if(event.key=='q' && event.altKey){
fulldoc=document.body.outerHTML;
scrollY=window.pageYOffset;
scrollX=window.pageXOffset;
}
if(event.key=='w' && event.altKey){
document.body.outerHTML=fulldoc;
document.body.scrollTo(scrollX,scrollY);
}
});
When the window looks the way you would want to scan, press 'Alt + Q', then press 'Alt + W'.
Now your window will freeze and then you can scan your page.
To steer the objects you need to refresh your browser.
You can resolve the issue with below 2 steps
1 - Add some text in textbox which will populate the dropdown below it .
2 - Use Send Keys Module to scroll down and select the value.
I had a similar issue where we had a popup that only appeared when clicking on a text box. The solution we received from the Tricentis trainer was as follows:
Part One
1. Open your application in Chrome
2. Right click the inspect
3. In the inspector window, on the Elements tab, navigate to your html element where it should be (you can do that by clicking on the element and check that you can see the html in the element)
4. Use the debugger to add a break point there, this should pause it and you should be able to see the elements you need to steer it.
5. Once you found the element, you will need the type of element (e.g. div, span, etc), and the class name
Part two
1. Rescan your module and select any element that matches the criteria of your element selected in Part One #5
2. Identify it by only it's class name property and tag
3. Save and close
4. Edit the element in the module view by changing the class name. This should help you steer it
Note: if the element class name is not unique, you might need to use Explicit name.
Good luck
I'm having problem with my work in blender, im using the latest version of the blende 2.78a.
But when i try to move my object and hit the x key then enter a value (2.50) it doesn't work.
Any help please =)
Did you first selected the object with right mousbutton and pressed the G key for moving the object?
If it still not works I have some other suggestions for you:
select the model, go to the panel on the right, press the "Object data" button (with the orange Cube on it) and then enter the numbers at "Location"
make sure you enter the numbers with a . not a , !!! (i also made this mistake)
press N to open an new propertiespanel on the right of the 3d-view and
look at the "Location"s; are the locks behind the coordinates blocked?
if so just click to unlock the positions
Is it possible in IntelliJ IDEA to move cursor to previous string when it is at the left corner of current string and I am pushing on left arrow keyboard key.
Let me explain:
1) Text cursor at the left corner of line 4
2) I am pushing on left arrow keyboard key
3) All I want to get - move text cursor to end of previous (3) line
But IDEA not moving text cursor from previous line, it just stays there.
Help me please.
This is because by default IntelliJ allows placing the caret after the end of line. When you press your ← key, it does not move as it would have to go to the infinite right side of your file, which is not very convenient (at least that's how I understand it :p).
Go to Settings > Editor and uncheck Allow placement of caret after end of line, this will solve your problem.
I am trying to select an entire line of text on a web page (in a table) using Sikuli. The easiest way to select the text is to "triple-click" on it. Is there a way to triple-click in Sikuli?
Thanks!
GregH,
I got the following to work for me:
click(img.png)
mouseDown(Button.LEFT)
mouseUp(Button.LEFT)
wait(0.01)
mouseDown(Button.LEFT)
mouseUp(Button.LEFT)
This allowed me triple click on a button, link, or whatever I needed to click on.
This works for me:
def tripleClick(PSMRL):
hover(PSMRL)
for x in xrange(3):
mouseDown(Button.LEFT)
mouseUp()
quick fix solution would be to check out the mouse settings in control panel and you can lower the time between clicks required to register successive clicks needed to perform the 'triple click' action
Have you tried low level mouse functions? Something like this should work:
for x in xrange(3):
region.mouseDown()
region.mouseUp()
Depending on what is being clicked, sometimes, the click type is the same as multiple clicks in succession. Meaning, if what needs to be clicked doesn't have to be double/triple-clicked very fast, then you can just use a sequence of single clicks. 2 clicks = double-click, 3 clicks = triple click. I know that 2 clicks will simulate a double-click on Windows desktop (not sure about things like games, etc.)
I've seldom heard of a triple-click action though.
So, have you tried using 3 clicks to simulate triple-click to see if that works or not?
I f you use .click() will be good enough.
.click() is the left mouse button, .rightClick() is the right mouse button.
For example:
image1 = ("image1.png")
def multiClick(nTime):
imageLoc = find(image1)
for n in xrange(nTime):
imageLoc.click()
# Click 3 times.
multiClick(3)