Image Events Oddity
Image Events Oddity
- Subject: Image Events Oddity
- From: Dan Doughtie <email@hidden>
- Date: Thu, 10 Feb 2005 11:26:54 -0500
Title: Image Events Oddity
I’m trying to use Image Events to add previews to images so that another app can use them (no preview the app rejects it).
I’ve had mixed luck with a FolderAction that combines save with icon with a file move.
To test the script I created a manual choose folder and then coercide the file names between string (which ImageEvents requires) and alias so the move and listing the folder can work.
But the image variable that opens the file fails when running the script in Script Debugger (doesn’t get defined) UNLESS
the Apple Event Log Window is open.
Why would a script fail or succeed based on whether or not a Apple Event Log window is open or not. I’ve duplicated this numerous times. Have not tried it yet with Script Editor
Here the script.
I’ve tried with and without the tell Finder. This version is with the Tell Finder. I added the globals and set to “” and tried it with and without
global my_image
set my_image to ""
global myPhoto
tell application "Finder"
set myFolderChoose to choose folder
set myFolder to myFolderChoose as string
set myList to list folder myFolderChoose without invisibles --Don't want the .ds_stor files etc.
repeat with x from 1 to number of items in myList
set myPhoto to item x of myList
set myPhoto to myFolder & myPhoto
set myPhoto to myPhoto as string
tell application "Image Events"
set my_image to open file myPhoto
save my_image with icon
close my_image
end tell
--now I change it back to an alias so the finder can move it
set myPhoto to myPhoto as alias
end repeat
end tell
--
Also the script doesn’t work with EPS’s or CMYK images which is probably a limitation of Image Events.
Dan Doughtie
Morris Technology Services
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden