• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Image Events and Preview
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Image Events and Preview


  • Subject: Re: Image Events and Preview
  • From: DeNigris Sean <email@hidden>
  • Date: Sun, 14 Feb 2010 10:56:32 -0500

I have a script that creates JPEGs. I wanted to display them to the user in Preview, but discovered that Preview isn't scriptable(!)
<snip>
And it would seem logical that Image Events must be using something like Apple Events to tell Preview to open the files. Now, if that's the case, then why the heck isn't Preview directly scriptable? 
Even though Preview doesn't advertise scriptability, it at least responds to events needed by GUI applications in Mac OS X, including open...
From http://developer.apple.com/mac/library/documentation/AppleScript/Conceptual/AppleScriptX/Concepts/osa.html:
Apple Events Sent by the Mac OS

The Mac OS takes advantage of Apple events to communicate with applications, such as to notify an application that it has been launched or should open or print a list of documents. Applications that present a graphical user interface must be able to respond to whichever of these events make sense for the application. For example, all such applications can be launched and quit, but some may not be able to open or print documents.

So you can just say: tell application "Preview" to open POSIX file "/path/to/file.jpg"

Sean DeNigris

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >Re: AppleScript-Users Digest, Vol 7, Issue 96 (From: DeNigris Sean <email@hidden>)

  • Prev by Date: Why must I double a command line to set the background picture?
  • Next by Date: Re: Why must I double a command line to set the background picture?
  • Previous by thread: Re: AppleScript-Users Digest, Vol 7, Issue 96
  • Next by thread: Why must I double a command line to set the background picture?
  • Index(es):
    • Date
    • Thread