Comments on: Minimal Scriptability Official blog of Red Sweater Software Fri, 09 Oct 2015 20:11:22 +0000 hourly 1 By: Daniel Jalkut Thu, 29 Sep 2011 00:42:56 +0000 Hi Joel – it still works in Lion, though there are some complications.

First, bear in mind that the Info.plist never had the NSAppleScriptEnabled parameter to begin with. You have to add it manually and set the value to true.

Second, since Apple now makes copious use of code signing, modifying the Info.plist will “break” the Preview app and cause it to stop launching entirely.

So if you wanted to do this trick, a safer way to do it would be:

1. Make a copy of and call it “”
2. Open the HackPreview Info.plist, and add the requisite NSAppleScriptEnabled flag
3. Open Terminal and re-sign the hacked copy:

codesign -f -s - /Applications/

4. Launch HackPreview and now try writing a script asking for documents of application “HackPreview”.

The point of this post was mostly to show what kind of sneaky stuff you can do if you go poking around in Plists. It doesn’t really have a lot of value for real scripting tasks. Probably Automator is a better solution for whatever PDF or images automation you might want to do.

By: Joel Wed, 28 Sep 2011 22:13:15 +0000 I hate to dig up an ancient post, but this is the best instructable I could find on this issue. However, it seems not to work for Lion (info.plist doesn’t have these parameters). Is there an alternative for those of us using this “improved” operating system?

By: christian boyce Fri, 16 Feb 2007 08:24:34 +0000 Fred, use Image Events to convert the folder of PSD files to JPGs. Here’s a link for you.

By: Daniel Jalkut Fri, 02 Feb 2007 15:01:53 +0000 Mike: I think Preview is still so relatively unscriptable this might be hard. But in your position I would look at Automator and some of the “PDF” actions. For instance, “Watermark PDF” will allow you to add just about anything (text, a picture, etc) over all the pages of a PDF.

By: Mike B Fri, 02 Feb 2007 05:40:16 +0000 Just curious to know if anyone has written a simple Preview script that will place a piece of text on each page of the document opened? Even adding text to the first page would be a plus. I work in a lab where lots of people use the same printer and it would help sort things out a bit.

By: Fred Wed, 24 Jan 2007 08:44:08 +0000 Is it possible to make a script to automatically convert a whole folder full of PSD files to JPGs?

I have enabled AppleScript on Preview, but the limited scripting may not be enough.

What about and Automator Action?

Any ideas?

GraphicConverter is way to buggy. It left many files corrupted after a loit of work. I ended up deleting them all because I couldn’t trust the output.
Preview can read and convert everything with no problem.
It’s just tedious to have to do it file by file.

By: Nehemiah Thu, 11 Jan 2007 20:08:41 +0000 Thank you for your help, I certianly wiill do that from now on.
Ore wa baka desu

By: Daniel Jalkut Wed, 10 Jan 2007 21:20:02 +0000 Nehemiah: yes, in particular one of the items in the Info.plist,
“CFBundleExecutable”, tells the operating system where to find the code that actually runs the app. In it should be called “Preview”. Is that still there?

I’m sure it goes without saying that you should always make a backup of such files in the future, before editing them. But yeah, if you need to replace it, you’ll just want to get a fresh copy of, either from another computer or by reinstalling.

By: Nehemiah Wed, 10 Jan 2007 21:12:59 +0000 When i tried this a few times, it didn’t work. Now Preview doesn’t launch. if I edit something unintentionally in the Info.plist file, could that stop the app from launching. if it does, how might i come by a replacement original for (aside from reinstalling from the install disk? i am prepared to do that)

By: Doug Adams Tue, 03 Oct 2006 00:12:31 +0000 Sal says it’s OK, and that’s good enough for me.