Identifier has " " in name - button

Currently stuck with this. There is a popup menu accessed by right clicking on a track name in the application "Pro Tools". I need to access this menu. After some time I have figured out how to click every other pop up menu on the button apart from one. The first part of the script is to identify the name of the window because it changes depending on the project but I've included it anyway.
Other buttons such as these:
pop up button "Playlist selector"
button "Track Record Enable"
button "TrackInput Monitor"
button "Solo"
button "Mute"
pop up button "Track View selector"
pop up button "Automation Mode selector"
pop up button "Track options"
All work fine.
The only difference is the name of the button.
The button I need is identified in UIElementInspector as
pop up button "Track name
\"Rhythm L\""
I believe the issue is caused by the fact there are " " 's in side of another set. When I run the script it says "expected end of line but found identifier"
activate application "Pro Tools"
tell application "System Events"
# Get the frontmost app's *process* object.
set frontAppProcess to first application process whose frontmost is true
end tell
# Tell the *process* to count its windows and return its front window's name.
tell frontAppProcess
if (count of windows) > 0 then
set window_name to name of front window
end if
end tell
tell application "System Events" to tell process "Pro Tools"
click pop up button "Track name "Rhythm L "" of group "Rhythm L - Audio Track " of window window_name
end tell

Related

Trying to set up a keyboard shortcut of a button inside a webpage and press it multiple times

My work is to watch videos, select some options and then press the "Submit" button. The thing is that the options I have to select are on the left side of the webpage and the "Submit" button is on the right side. I think I will be able to do my work faster if I can make a keyboard shortcut to press the "Submit" button. I somehow built this code
var button1 = document.getElementById("_SSsubmit");
window.addEventListener('keydown', function(e) {
if (e.altKey == true && e.keyCode == 83)
button1.click();
});
I put it in Chrome's Developer Tools Console and it works only 1 time. The next time when I press "Alt + S" - nothing happens. Is there a way I can make it work while the tab is opened?
The event listener itself will trigger multiple times so long as the page isn't reloaded, you can test this by replacing the button1.click() with a simple console.log(). It seems to me that either:
a) the page is being reloaded every time you submit, in which case you would need to paste the code into the console every time the page loads or
b) the submit button element is getting replaced with a new element each time, in which case you would need to re-assign button1 every time. Most likely, the page is being reloaded.
In either case, your best bet here is probably writing a small Chrome extension so that you won't need to keep pasting code into the console.

How to add condition when element presented only?

My app behave like this:
Add items -> user clicks Add button -> app return to main page
IF there are too many items, after user clicks Add button -> new dialog prompt 'waiting...', then user click OK button -> user click send button again
it is a loop if the new dialog prompt after send button is clicked. (from manual testing, this dialog could appear 2-3 times only).
I have written test case after click add ->
if there is dialog appear then click ok -> click add -> back to mainpage.
it is working fine when the new dialog appear.
I noticed if the new dialog does not appear, ROBOT still proceed to the ${VERIFIED} lines....this causing the script pausing for quite sometimes. no error but how do I get rid of it?
However the application may prompt the dialog many times when server loading is slow.
I want robot press this ok whenever dialog appear again then click add.
How do I achieve it?
Add Item
Click Add
${VERIFIED} Run Keyword And Return Status Wait Until Page Contains Element ${ANDROID-WIDGET-TEXT-VIEW}\[#text='Please wait'] 3s
Run Keyword If ${VERIFIED} Wait Until Page Contains And Click ${ANDROID-WIDGET-BUTTON}\[#text='OK']
Run Keyword If ${VERIFIED} Click Add
Wait Until Page Contains Navigation Bar Title MainPage

Applescript Mojave Click Image Capture Button

How does Applescript click button "Delete" in Mojave Image Capture?
In ML, this works --
activate application "Image Capture"
tell application "System Events"
click button 3 of group 1 of splitter group 1 of window "Image Capture" of application process "Image Capture" of application "System Events"
end tell
-- and I have not yet got the equivalent for Mojave. Thank you.
They moved things around a little. Try this:
tell application "System Events"
tell process "Image Capture"
set frontmost to true
click window "Image Capture"'s splitter group 1's group 2's button "Delete"
key code 48 -- tab to move focus to 'delete'
-- key code 36 -- return key
end tell
end tell
I added code that clears the "Are you sure?" dialog and automatically deletes the image, but I commented out the 'key code 36' line, which simulates a return key, because I didn't want you to accidentally delete something important.
Debugging GUI scripting
if the above code throws an error, and you don't have UIElementExplorer or UIBrowser (apps that drill down through the GUI), you can debug this running the following code in Script Editor:
tell application "System Events"
tell process "Image Capture"
tell window "Image Capture"
tell splitter group 1
entire contents
end tell
end tell
end tell
end tell
This is slow, and produces a huge mass of text in the script log that shows every element of the GUI from splitter group 1 on down. Search for 'Delete' in the log as I did in the image below: click the log button (circled in green), type command-F and enter the term 'delete' (circled in red), and it will show you the entry for the delete button. Then just copy that path into code.
You may need to change focus (i.e. put the entire contents line after the window "Image Capture" line to get a wider scope).
Note that the GUI may change as you add different devices and browse in different modes, and when the GUI changes all of the indexes (splitter group 1, group 2, button 7) might change as well. You may need to test this with a couple of different configurations if you use multiple devices to see what's going on.

Cannot get click="{ myTabNavigator.selectedIndex=3}" to work

I have a mx:TabNavigator with 5 tabs. As a secondary navigation option for the user there is a "Next" button on each tab that takes the user to the next tab. Each "Next" button uses click="{ myTabNavigator.selectedIndex=x}" set to move to the next tab where x is the tab number. All of them work except for the one on tab 2 which is supposed to take the user to tab 3. Nothing happens.
I can copy this button to tab 0 and it works fine taking the user to tab 3. It just will not work from tab 2.
I have tried moving myTabNavigator.selectedIndex=3; to an event handler and have confirmed that the click event is calling the event handler, but it doesn't work from there either.
I have cleaned the project, restarted Flash Builder and the browser and cleared the cache in the browser. Cannot get it to work.
Any suggestions?
Thanks,
John
I found the problem. I found that the tab 2 itself had click="{EditDetailsTabNavigator.selectedIndex=2}" in it. Took this out and the button works. Guess every time I clicked in the tab it would fire.
Not exactly sure how it got there, but I have found when pasting into a property in Design mode that occasionally the paste goes some place else in addition to where I have the cursor. I think that is how it might have gotten there.

Drupal Views: Display recent nodes created by user on profile page

I'm wondering how I can display the recently created nodes by a user on their profile page. I've created a new page for a user at /user/%user and I want to be able to display the latest nodes created by that user.
ok, the answer involves creating a drupal view, so you will need the views module and although simple, the answer is lengthy. please bear with me through this... :) (i am actually doing this on a test site as i write the instructions, to make sure i dont miss anything...)
i assume that you know how to download and install the views module. make sure you also enable the views-ui module.
go to site building->views->add.
put "recent_posts_by_user" for view name, "recent posts by user" for description and "node" for view type. hit next.
under the "default" view type, on the "fields" block, hit the "+" sign.
under "groups" select node, then check the "node type", "node title" and "node updated date" fields. hit the "add" button below the list.
under basic settings block (on the left), click on the "10" for "items for display" and change to "5" or however many items you want per page, and hit "update"
under "use pager", click on "no" and "full pager" or "mini pager" and hit "update" again.
under style, hit "unformatted" and change it to "table" set all fields to sortable, then choose the "updated date" as "default sort", then on "default sort order", select "descending". hit update.
hit "save" to save your progress thus far.
default view is done. YAY! lets add the block
now on the drop-down that says "page", select "block" and hit "add display".
hit "arguments" (block title on the center of the screen)
hit "override" and "update"
hit the "+" sign to the right of "arguments"
on the "groups" drop down, select "user" and select "user id". hit "add"
under "Action to take if argument is not present", select the last option "provide default argument", select "user id from url" and check "Also look for a node and use the node author"
under "validator", select "user" and "Allow both numeric UIDs and string usernames"
under "Action to take if argument does not validate" select "hide view/page not found (404)"
hit "update" then "save"
view is created now lets make sure it shows up on the right pages.
go to site building->blocks, search for the "recent posts by user" block and hit "configure"
scroll all the way to the bottom and select "Show on only the listed pages." and put in "users/*" under the "pages" text area
hit "save block"
now find the "recent posts by user" block again and set it to "content bottom" region (or any other region your theme has available).
hit "save blocks"
DONE! Not rocket-science, but lengthy process... drupal 6 views is so much better than drupal 5! :)
now go visit a user page http://site/users/username and see the table show up there!
hit me up if you still have questions about views.
enjoy
Put in a Views Argument that uses the User ID from the URL argument. It will be arg(1). That should filter content that was authored by the profile you are looking at. That can work for a block or content pane.
I just prefer you to go to Views -> Sort Criteria and add the Node:Updated Date and mark it as descending as it shows the granularity over the time.
Moreover, you can also get the most recent node not only to the table style but to all.

Resources