Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How can I say an Application "Push that button"?

Hi all,

I have set up a script to launch an application, and this works.


But the application opens and waits for the user to push the button "AVVIO" ("Start") to run.


I would like to tell the application, through the script, to push that "Start" button but have no idea.


(Btw, I am new to Applescript programming, so please don't shot!!)


Thanks all!!

User uploaded file

Posted on Jul 5, 2014 8:47 AM

Reply
9 replies

Jul 9, 2014 12:09 PM in response to rccharles

Thanks,

I tried the suggestion of sending a "return" key.


I added the lines

tell application "System Events"

key code 36

end tell

And it works the first time I launch it; then if I close the app and relaunch, I get the window with the button to press.


Then, using suggestione of second link you sent, I added these lines

tell application "System Events" to tell process "RealtymeSync"

delay 0.5

tell process "RealtimeSync" to keystroke return

end tell

and it seems to work also on following request to launch the application.

Doing more tests but I'm faithful.

Thank you.


I will report the result of testing.

el

Jul 10, 2014 12:59 PM in response to rccharles

By the way, just for completion, here is the whole script:

tellapplication "Finder"

if (count of Finder windows) = 0 then

open folder "Documents" of home

else

set target of first Finder window to folder "Documents" of home

end if

settargetofFinder window 1 tofolder "Applications" ofstartup disk

set target of Finder window 1 to folder "FreeFileSync_6" of folder "Applications" of startup disk

open application file "RealtimeSync.app" of folder "FreeFileSync_6" of folder "Applications" of startup disk

end tell


tell application "System Events" to tell process "RealtymeSync"

delay 0.5

tell process "RealtimeSync" to keystroke return

endtell

tellapplication "Finder"


closeFinder window 1

end tell

How can I say an Application "Push that button"?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.