Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Doing this in one fell swoop' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Doing this in one fell swoop
Authored by: sjonke on May 14, '01 02:44:20PM

If you want to run an Applescript command in one fell swoop, you can pipe in output from echo. For example, to launch the OS X application OmniWeb you can type in this:

echo 'tell application "OmniWeb" to activate' | /usr/bin/osascript

I'm no Unix expert, this is just a way I've found to do it - is there a better way (other than piping in echo) to get input into a Unix utility like this?

[ Reply to This | # ]
Running scripts remotely?
Authored by: sjonke on May 14, '01 03:52:37PM

Regarding my previous comment, never mind. Here is the right way to do it:

/usr/bin/osascript 'tell application "OmniWeb" to quit'

Anyway, is there any way to get osascript to work when logged in (ssh) remotely? When I try this, I get various errors. For example if I try to tell the Finder to quit I get the error "Finder got an error: Application isn't running. (-600)", however it clearly is running.

[ Reply to This | # ]
Running scripts remotely?
Authored by: sahmad on Oct 12, '01 09:16:27PM

I have been having the same exact problem when trying to run applescripts using 'rsh' from a remote machine.

Any envelope perl scripts are executed correctly by Darwin. Only the osascript/applescript section fails.

I can do rsh for other commands but not osascript related stuff. Is there some sort of built-in protection?

This really limits my ability to control automation on OSX macs. We currently do such tasks on MacOS9.X machines.

Any pointers will be appreciated!

[ Reply to This | # ]
Running scripts remotely? (yes!)
Authored by: rajiv on Nov 01, '01 03:51:36PM
if you don't need to craft the script on the command line and can put a self-running script on the mac, you can just use the 'open' command. check out Securely run remote AppleScripts for details.

[ Reply to This | # ]