Yes, You Can Applescript “Unscriptable” Applications (like Preview)… A Little
Even though Preview doesn’t advertise scriptability, it at least responds to events needed by GUI applications in Mac OS X, including open…
From Mac Dev Center:
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, for example:
tell application "Preview" to open POSIX file "/path/to/file.jpg"
Categories: Uncategorized