The unlikely persistence of AppleScript
Posted 12 December 2012 - 06:52 AM
Posted 12 December 2012 - 06:53 AM
I haven't found that at all. The things I want to automate - mail, iTunes are scriptable. There's even the UI events to let you script menu commands, button clicks for apps that aren't scriptable. Is there something in particular you are looking for?
Posted 12 December 2012 - 08:28 AM
Posted 12 December 2012 - 10:51 AM
Preview isn't scriptable. Numbers has a very limited set of AS features. You can't even create a new document without falling back to the hack of GUI scripting. Many applications, including mail, have very limited scriptability. Try to create a smart mailbox in AS for instance or robustly control the content of a message. (i.e. beyond plain text) Try and create a search to find mail messages via some criteria and then get information about the mail content. You can't. There's a ton of things frustrating with Mail's Applescript. I could go on about Apple's other applications but clearly Apple stopped caring about scriptability in their own apps about the time of Snow Leopard.
Posted 12 December 2012 - 11:13 AM
Look at this example from www.danpouliot.com/xvsxp/XvsXP.pdf
Example: Scripting Speech
var vt = WScript.CreateObject("Speech.VoiceText");
var phrase = "Is there something I should say?";
if ( WScript.Arguments.length )
phrase = WScript.Arguments(0);
while ( vt.IsSpeaking )
"Just take the lines above, save them in a file named SAYIT.JS, and run the file. You should hear it say "Is there something I should say?" (If you get an error message instead, you probably need to install Microsoft Agent [this was a free download from MS's developer site, however the link has disappeared].)
say "Is there something I should say?"
or something cooler...
say "This is cool" using "Kathy" saving to "someText.aiff"
Posted 12 December 2012 - 11:33 AM
I agree that AppleScript's reputation as a "read-only" language can lead to frustration. But what annoys me even more is the incomplete and buggy implementations that trouble so many applications. When you can't get a script to work, you never really know whether it's something you did wrong, or a bug in the AS interface (better error messages could help a lot here).
That said, AppleScript is a major—maybe even THE main—reason that I've stuck with the Mac all these years. If it went away, I just wouldn't have that much incentive to hang around. Are you listening, Apple?
Posted 12 December 2012 - 02:14 PM