Macworld Forums

Macworld Forums: The unlikely persistence of AppleScript - Macworld Forums

Jump to content

  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

The unlikely persistence of AppleScript

#1 User is offline   Macworld 

  • Story Poster
  • Group: MW Bot
  • Posts: 31,680
  • Joined: 30-November 07

Posted 12 December 2012 - 05:32 AM

Post your comments for The unlikely persistence of AppleScript here
0

#2 User is offline   jscotta 

  • Member
  • PipPip
  • Group: Members
  • Posts: 86
  • Joined: 06-May 01

  Posted 12 December 2012 - 06:38 AM

I find it ironic that Apple is the worst developer for including Applescript/Automator support in its own applications. I also find it damned aggravating.
2

#3 User is offline   patriotusa 

  • Member
  • PipPip
  • Group: Members
  • Posts: 134
  • Joined: 09-September 04

  Posted 12 December 2012 - 06:52 AM

I have used Applescript to automate graphic production processes at two major ad agencies and now at a major cosmetics company. For example, when I save files from Photoshop I use a script that automatically names the files and places them where they need to go on our file server, simultaneously creating a low-res PDF proxy of the image that we use in a custom prepress workflow that is also completely automated using Applescript. A duplicate of the proxy image is also added to our image catalog which we use as a "poor man's DAM" using Adobe Bridge. This frankly works better than our enterprise DAM that we have spent tens of thousands of dollars on. Whenever we update images the proxy files are also automatically updated by the save scripts. And this is just a part of how we use Applescript to automate our workflows. In short, I would be very, very, very, very sad to see this technology deprecated.
0

#4 User is offline   hayesk 

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 1,791
  • Joined: 07-August 04

  Posted 12 December 2012 - 06:53 AM

Quote

I find it ironic that Apple is the worst developer for including Applescript/Automator support in its own applications. I also find it damned aggravating.


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?
0

#5 User is offline   quakerotis 

  • Member
  • PipPip
  • Group: Members
  • Posts: 315
  • Joined: 12-June 07

  Posted 12 December 2012 - 07:33 AM

Shakespeare wrote
"There Taming of the Shrew" with AppleScript.
0

#6 User is offline   dougscripts 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 5
  • Joined: 20-October 11

  Posted 12 December 2012 - 07:33 AM

AppleScript is a gateway programming language. Watch how quickly you start diddling in AppleScript and then move on to shell scripting, JavaScript, perl, Python, Ruby, and even Objective-C.
0

#7 User is offline   PrachiGauriar 

  • Member
  • PipPip
  • Group: Members
  • Posts: 20
  • Joined: 28-September 10

  Posted 12 December 2012 - 08:28 AM

As a programmer, I find the AppleScript language to be really frustrating, but it really enables you to do some awesome things. I’ve found that using the scripting bridge with a more traditional scripting language gives me the best of both worlds.

http://www.macosxaut...tingbridge.html
0

#8 User is offline   TheBum 

  • Member
  • Group: Macworld Insiders
  • Posts: 411
  • Joined: 08-June 04

  Posted 12 December 2012 - 08:55 AM

I've found Automator useful for everything except mostly what I want to do. It definitely only provides a miniscule subset of the capabilities that direct AppleScript does.
0

#9 User is offline   Stingerman23d4 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 2
  • Joined: 06-July 11

  Posted 12 December 2012 - 09:21 AM

Automator is built on top of the Unix Pipes concept not Applescript.
0

#10 User is offline   ClarkGoble 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 1
  • Joined: 12-December 12

  Posted 12 December 2012 - 10:51 AM

Quote

I find it ironic that Apple is the worst developer for including Applescript/Automator support in its own applications. I also find it damned aggravating. 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?


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.
1

#11 User is offline   Arygaetu 

  • Member
  • PipPip
  • Group: New Members
  • Posts: 19
  • Joined: 20-September 12

  Posted 12 December 2012 - 11:13 AM

Why AppleScript?
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.
1

#12 User is offline   Matt1000 

  • Member
  • PipPip
  • Group: Members
  • Posts: 79
  • Joined: 24-October 05

  Posted 12 December 2012 - 11:29 AM

Quote

Why AppleScript? ...


Because you have access to a much wider set of tools than executing some basic javascript.
0

#13 User is offline   RobLewis 

  • Member
  • PipPip
  • Group: Members
  • Posts: 260
  • Joined: 16-April 01

  Posted 12 December 2012 - 11:33 AM

Thank you, John, for the best discussion of AppleScript I've seen, ever!

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?
0

#14 User is offline   wardoggie 

  • Veteran
  • Group: Macworld Insiders
  • Posts: 1,660
  • Joined: 02-September 04

  Posted 12 December 2012 - 02:14 PM

I know very, very little about programming, but I love AppleScript and Automator! I also love the macro capabilities built into some applications, like Photoshop. Computers should make my life easier and performing repetitive tasks for me via scripting does exactly that. Plus, it's fun! (Well, it is once you get past the "pulling your hair out trying to figure out why a script doesn't work" part.)
1

Share this topic:


  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users