I can’t display dialog over a network using apple-script. I can connect to the computer but can not display a dialog using apple-script. Could anyone suggest a script to make this work??????
Thanks
Tom
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To display a dialog on a remote machine you have to first setup an AppleScript application that runs on that machine.
On the remote machine
Save the above script as an Application: name it DialogHelper and flag the Stay open checkbox when saving. You can save it on the Desktop or wherever you like. Then run the Application and let it stay open.
Then from the local machine you invoke that AppleScript application to display the dialog.
On the local machine
–
Note that “Remote Apple Events” must be enabled in the Sharing Preferences on the target (remote) machine to allow this to work.
Of course the name of the machine (toms-mac.local in the example) must match with the one you see when opening the same preferences.
I’ve just tried, and it works between two Macs running Mac OS X 10.7 and connected on a local network
Side note
Normally scripting events that require user interaction (as display dialog) are not allowed between two machines, and trying to fire them end in a -1713 error.
Wrapping display dialog in the tell application “AppleScript Runner” block is a workaround to that limitation.
See also:
http://wisevishvesh.wordpress.com/2010/10/14/applescript-execution-error-no-user-interaction-allowed-1713/