Wednesday, August 3, 2011

How to AppleScript like a boss - Writing object oriented AppleScripts




set fileReference to ((path to applications folder) as string) & "iTunes.app:Contents:Resources:genre-animation.jpg"


set myPhotoshopController to my PhotoshopController()

myPhotoshopController's openDocument(fileReference)


on PhotoshopController()

script alloc

on openDocument(fileReference)

tell application "Adobe Photoshop CS3"

activate

open file (fileReference) showing dialogs never

end tell

end openDocument

end script

copy alloc to init

return init

end PhotoshopController







No comments:

Post a Comment