Scripting Image Events - some kind of bug ?
Scripting Image Events - some kind of bug ?
- Subject: Scripting Image Events - some kind of bug ?
- From: Jay Louvion <email@hidden>
- Date: Tue, 13 Sep 2005 10:34:30 +0200
Title: Scripting Image Events - some kind of bug ?
Hi all,
I’m currently trying to put on the road a script to scale images by recreating their hierarchy next to their original folder.
One of my attempts brought this question in light:
If I specify a save path for the final low-def files that iincludes a folder that doesn’t exist, will that folder be created or will an error be returned. The answer: neither. Anybody want to throw in some advice, a comment or both ?
This is the script, I commented out the bits using 24U appearance OSAX.
set thisFolder to (choose folder)
set decided_width to text returned of (display dialog "What width in pixels should the images be resized to ?" default answer "")
tell application "Finder" to set EveryPicture to (every item of entire contents of thisFolder whose name extension is "jpg") as alias list
(*
set NumberOfFiles to number of items in EveryPicture
set incrementprogress to 0
set ImageResizeProgress to create progress indicator with properties {global window:true, name:"Resizing Pictures", closeable:true, indeterminate:false, top message:"This might take some time.", bottom message:"Please be patient...", current value:0, minimum:0, maximum:NumberOfFiles}
*)
with timeout of (length of EveryPicture) * 5 seconds
repeat with OneFile in EveryPicture
tell application "Finder" to set FileName to name of OneFile as text
set LDFileName to ("LD_" & FileName) as string
tell application "Image Events"
launch
set TheFinalFileString to ((thisFolder as text) & "bogus_folder_name" & ":" & LDFileName) as string
set this_image to open OneFile
scale this_image to size (decided_width as integer)
save this_image in file TheFinalFileString with icon
close this_image
end tell
(*
set incrementprogress to incrementprogress + 1
update progress indicator ImageResizeProgress current value incrementprogress
*)
end repeat
end timeout
--close progress indicator ImageResizeProgress
Jay Louvion
Studio Casagrande
3, rue Müller-Brun
1208 Geneva
T+4122 840 3272
F+4122 840 3271
skypeme:
jaylouvion
www.studiocasagrande.com
_______________________________________________
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