Hi all,
First post here. I have a very simple applescript that is supposed to get the dimensions of an image and then go on from there to do run actions in photoshop based on the dimensions. However, it insists on opening photoshop on the Image Event command ‘open’. I’m totally new to applescript, so I’m sure I’m doing something wrong here. I just don’t know what.
Here it is and thanks in advance for any help:
tell application “Finder”
activate
set sourceFile to choose folder with prompt "choose folder"
set these_items to get every item of (entire contents of folder sourceFile) whose kind ≠"Folder"
-------
repeat with i from 1 to the count of these_items
set this_item to (item i of these_items)
--------
tell application "Image Events" <-----------------------------------(this part doesn't work)
launch
set theImage to open this_item
set {x, y} to this_item's dimensions
if x > y then
delay 15
--------
tell application "Finder" to tell (open (this_item))
end tell
tell application "Adobe Photoshop CC 2015"
activate
delay 0.25
do action "MB-DrivePhotos-Horiz" from "Skelly_Actions"
end tell
---------
else if x < y then
tell application "Finder" to tell (open (this_item))
end tell
tell application "Adobe Photoshop CC 2015"
activate
delay 0.25
do action "MB-DrivePhotos-Horiz TEST" from "Skelly_Actions"
end tell
end if
end tell
end repeat
end tell
Model: iMac
AppleScript: AppleScript 2.4
Browser: Safari 537.36
Operating System: Mac OS X (10.10)