Comments on: Minimal Scriptability http://www.red-sweater.com/blog/150/minimal-scriptability Mac & Technology Writings by Daniel Jalkut Sun, 16 Mar 2014 19:39:31 +0000 hourly 1 http://wordpress.org/?v=3.8.1 By: Daniel Jalkut http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-249428 Thu, 29 Sep 2011 00:42:56 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-249428 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 Preview.app and call it “HackPreview.app”
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/HackPreview.app

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 http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-249358 Wed, 28 Sep 2011 22:13:15 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-249358 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 http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-56809 Fri, 16 Feb 2007 08:24:34 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-56809 Fred, use Image Events to convert the folder of PSD files to JPGs. Here’s a link for you.

http://www.apple.com/applescript/imageevents/

]]>
By: Daniel Jalkut http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-50747 Fri, 02 Feb 2007 15:01:53 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-50747 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 http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-50525 Fri, 02 Feb 2007 05:40:16 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-50525 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 http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-46940 Wed, 24 Jan 2007 08:44:08 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-46940 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 http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-43139 Thu, 11 Jan 2007 20:08:41 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-43139 Thank you for your help, I certianly wiill do that from now on.
俺輪馬鹿です
Ore wa baka desu

]]>
By: Daniel Jalkut http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-42833 Wed, 10 Jan 2007 21:20:02 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-42833 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 Preview.app 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 Preview.app, either from another computer or by reinstalling.

]]>
By: Nehemiah http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-42829 Wed, 10 Jan 2007 21:12:59 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-42829 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 Preview.app? (aside from reinstalling from the install disk? i am prepared to do that)

]]>
By: Doug Adams http://www.red-sweater.com/blog/150/minimal-scriptability/comment-page-1#comment-17128 Tue, 03 Oct 2006 00:12:31 +0000 http://www.red-sweater.com/blog/150/minimal-scriptability#comment-17128 Sal says it’s OK, and that’s good enough for me.

]]>