Macworld Forums

Macworld Forums: Mac OS X Hints Weblog: Add AppleScript support to Preview - Macworld Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Mac OS X Hints Weblog: Add AppleScript support to Preview

#1 User is offline   Macworld.com 

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 1,900
  • Joined: 06-February 04

Posted 13 October 2006 - 09:20 AM

Use a simple Terminal command to add basic AppleScript support to Preview. [more]
0

#2 User is offline   leicaman 

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 2,849
  • Joined: 04-December 03

Posted 13 October 2006 - 04:24 PM

Quote:

Use a simple Terminal command to add basic AppleScript support to Preview.


Very strange, since Automator does things in Preview no problem. I guess it's using Coca rather than Applescript to do it? /forums/ubbthreads/images/graemlins/wink.gif
0

#3 User is offline   griffman 

  • old friend
  • Group: Macworld Insiders
  • Posts: 8,788
  • Joined: 09-January 01

Posted 13 October 2006 - 06:13 PM

Yea, I'm not sure how Automator works its magic ... but if you use Script Editor's "Open Dictionary" command, you can see that Preview completely lacks an AppleScript dictionary.
-rob.
0

#4 User is offline   macnews 

  • Member
  • PipPip
  • Group: Members
  • Posts: 487
  • Joined: 11-January 05

Posted 15 October 2006 - 11:27 AM

Quote:

Quote:

Use a simple Terminal command to add basic AppleScript support to Preview.


Very strange, since Automator does things in Preview no problem. I guess it's using Coca rather than Applescript to do it? /forums/ubbthreads/images/graemlins/wink.gif


When I first heard about automator I thought it would be a great way to, well, automate some repetative tasks. I thought it would be an easier way to do what apple script can do with an intuitive interface. That turned out to not be the case. While automator seems a bit easier, I don't fully understand what it can do, how to do it and what the limitations are. Does anyone know of some recommended reading that could perhaps help me with automator?
0

#5 User is offline   mjg 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 05-May 06

Posted 16 October 2006 - 04:41 PM

Quote:

Yea, I'm not sure how Automator works its magic ... but if you use Script Editor's "Open Dictionary" command, you can see that Preview completely lacks an AppleScript dictionary.


Automator uses its own programming framework rather than AppleScript or its underlying Apple Events. This allows Automator actions to be written in several different programming languages (including AppleScript, Objective-C and shell scripts) and use things other than scriptable applications.
0

#6 User is offline   nidgamer 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 14-April 06

Posted 10 January 2007 - 04:30 PM

when i did this, (from the terminal, su admin account) i preview stopped launching. i dont know how to fix this. could somemone tell me how to get a replacement file or if i just have to reinstall Preview from the DVD. I dont know if that will be easy; how much i can cusomize that archive-reinstall.
0

#7 User is offline   rameeti 

  • Member
  • PipPip
  • Group: Members
  • Posts: 220
  • Joined: 29-September 03

Posted 18 October 2009 - 03:48 PM

This does not seem to work in Snow Leopard. Is there a new method?
0

#8 User is offline   griffman 

  • old friend
  • Group: Macworld Insiders
  • Posts: 8,788
  • Joined: 09-January 01

Posted 19 October 2009 - 03:17 AM

For SL, not that I've heard.

-rob.
This space intentionally left blank.
0

#9 User is offline   nbidgood 

  • Member
  • PipPip
  • Group: Members
  • Posts: 47
  • Joined: 10-June 08

  Posted 04 December 2011 - 10:10 AM

!!!!!!!!!! DO NOT TRY THIS IN SNOW LEOPARD OR LION !!!!!!!!!!

It will break Preview and even deleting the key from Preview's defaults won't fix it. Luckily I was able to salvage a functional Preview from Time Machine.
0

#10 User is offline   Pigeo 

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

Posted 26 June 2012 - 04:36 AM

 nbidgood, on 04 December 2011 - 10:10 AM, said:

!!!!!!!!!! DO NOT TRY THIS IN SNOW LEOPARD OR LION !!!!!!!!!!

It will break Preview and even deleting the key from Preview's defaults won't fix it. Luckily I was able to salvage a functional Preview from Time Machine.


It also work on Snow Leopard (and probably Lion also) *BUT* obviously, you need to add the following commands after the defaults write command :

sudo plutil -convert xml1 /Applications/Preview.app/Contents/Info.plist
sudo chmod a+r /Applications/Preview.app/Contents/Info.plist


(since the format of the Info.plist has changed in Snow Leopard, so it needs to be converted with plutil...)

This post has been edited by Pigeo: 26 June 2012 - 04:39 AM

0

#11 User is offline   billybillybillybilly 

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

  Posted 22 August 2012 - 07:58 PM

This article should be removed and/or updated to let LION users know that running the command line script will f*ck up your Preview.app! I had to re-download Mountain Lion, show package contents, mount InstallESD.dmg and run/install Essentials.pkg. Preview.app can't be replaced/removed/modified, so you can't just copy Preview.app from one machine to the broken machine. Thanks a lot Mac World... Really annoying (I guess it's my fault for not reading the comments, but still... Update your damn article!)
0

#12 User is offline   Chris Breen 

  • Advanced Member
  • Group: Moderators
  • Posts: 5,929
  • Joined: 11-December 00

Posted 22 August 2012 - 11:36 PM

 billybillybillybilly, on 22 August 2012 - 07:58 PM, said:

This article should be removed and/or updated to let LION users know that running the command line script will f*ck up your Preview.app! I had to re-download Mountain Lion, show package contents, mount InstallESD.dmg and run/install Essentials.pkg. Preview.app can't be replaced/removed/modified, so you can't just copy Preview.app from one machine to the broken machine. Thanks a lot Mac World... Really annoying (I guess it's my fault for not reading the comments, but still... Update your damn article!)


Always good to check the publication date on these things -- particularly when they're as old as 2006.

#13 User is offline   mangledorf 

  • Newbie
  • Pip
  • Group: New Members
  • Posts: 1
  • Joined: 17-March 13

  Posted 17 March 2013 - 07:56 AM

Yet another person screwed by this article. Please remove or add a warning at the *top*.
0

Share this topic:


Page 1 of 1
  • 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