The unlikely persistence of AppleScript
#1
Posted 12 December 2012 - 05:32 AM
#2
Posted 12 December 2012 - 06:38 AM
#3
Posted 12 December 2012 - 06:52 AM
#4
Posted 12 December 2012 - 06:53 AM
Quote
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?
#5
Posted 12 December 2012 - 07:33 AM
"There Taming of the Shrew" with AppleScript.
#6
Posted 12 December 2012 - 07:33 AM
#7
Posted 12 December 2012 - 08:28 AM
http://www.macosxaut...tingbridge.html
#8
Posted 12 December 2012 - 08:55 AM
#9
Posted 12 December 2012 - 09:21 AM
#10
Posted 12 December 2012 - 10:51 AM
Quote
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.
#11
Posted 12 December 2012 - 11:13 AM
Look at this example from www.danpouliot.com/xvsxp/XvsXP.pdf
Example: Scripting Speech
MS:
var vt = WScript.CreateObject("Speech.VoiceText");
vt.Register("", WScript.ScriptName);
var phrase = "Is there something I should say?";
if ( WScript.Arguments.length )
phrase = WScript.Arguments(0);
vt.Speak(phrase, 1);
while ( vt.IsSpeaking )
WScript.Sleep(100);
WScript.Quit();
"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].)
OS X:
say "Is there something I should say?"
or something cooler...
say "This is cool" using "Kathy" saving to "someText.aiff"
'Nuff said.
#12
Posted 12 December 2012 - 11:29 AM
Quote
Because you have access to a much wider set of tools than executing some basic javascript.
#13
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?
#14
Posted 12 December 2012 - 02:14 PM
Help











