AppleScript is one of those technologies that has awing potential difference , but seems to be “ not quite there yet ” in many ways . The basic problem is that patronize AppleScript is up to the program program ’s authors , not the atomic number 76 . So in club for an program to be scriptable , the developers must allow the support for it . As a solvent , we wind up with many apps that wo n’t verbalise a word of AppleScript — Quicken , for instance . Many other apps , such as Firefox , have just the bare necessities , making it difficult to drop a line useful scripts for these programs .
OK , so some third - company apps have wretched AppleScript financial backing . for certain that ’s not a problem for Apple ’s own apps , right ? Not whole right . Some apps , such as iPhoto andiTunes , have strong support for AppleScript . Others , though , lack support entirely — iMovie , Backup , Calculator , etc . Perhaps the biggest surprisal , though , is that Preview is on the list of non - supported app . Given its grandness in opening nigh any kind of icon on your machine , this seems like a key oversight . For instance , consider this elementary AppleScript , which attempt to close up an overt windowpane in Preview :
That ’s because Preview does n’t corroborate even the basic AppleScript dictionary . So here ’s the tip — you may tally basic ( not pure , but useable ) AppleScript living to Preview — or any other software which lacks it . You wo n’t gain full admission to the app via AppleScript , of course , but you will get ahead access to the received AppleScript suites — Standard Suite , Text Suite , and Type Definitions . These basic suites will let you do thing like manipulate window , print images , open and cheeseparing file , etc .
So how do you add this support ? There are two methods — one via Terminal , and the other through ( fittingly ) an AppleScript . Before using either , throw in the towel Preview if it ’s running . And just to be safe , make a copy of Preview and name it “ Preview Original Version ” or somesuch .
Terminal method
Open Terminal ( in /Applications - > Utilities ) and course this command :
That ’s it for the Terminal method acting — not too hard , was it ?
AppleScript method
Click Compile , then Run . That ’s it , you ’re done . ( Thanks to Apple ’s AppleScript guru , Sal Soghoian , for post the above book as a comment tothis poston the red sweater web log .
What you did
Regardless of which method you used , you just tell the system to modify the Info.plist file for Preview , and add one boolean (
As an representative , launch Preview , open an image , and then render the original AppleScript again :
Instead of an error , the window will simply vanish . Nice ! you’re able to utilise this same proficiency to add introductory AppleScript reinforcement to other applications , though you ’ll have the best luck with Cocoa applications ( as their basic AppleScript support is much nice than that of Carbon app ) . Readthis poston the red sweater web log for more info on this tip , including a more advanced Preview script that takes advantage of the fresh - added AppleScript support .
Of course , if anything goes wrong , you’re able to just cancel your modified program program and rename the backup you make before you started . You did make one first , right ?