Hi All,
I have been searching for a way to run an Applescript on a remote server via an ssh command. The idea would be ultimately to set up commands for certain scripts and then write them into an iphone so I can fire these off remotely with each action applied to a button.
The first step, of course, is figuring out how to run an Applescript remotely. So far, I have tried.
However, I am lost when they are saying name something run.applescript. I can rename my scripts suffix (scpt) to (applescript) but it translates it to garble. Any thoughts on this?
When you run a script using osascript, you can get errors if you try to display a dialog box. For example, in normal aplescript you can just use display dialog “whatever”. However if you try this with osascript then you will see the error you described because osascript doesn’t know how to display a dialog. The fix is simple, just tell an application to display the dialog. I see from the link you provided they were using “Applescript Runner”. The Finder works too…
tell application "Finder" to display dialog "whatever"
As far as your question about “.applescript”… that file extension is for an applescript which was saved as a text file under the “Save As” menu. You do not need to use this. Save your script as a “scpt” or “scptd” compiled script and just use that path in your command.