Droplet to Rename Breaks Under Jaguar
Droplet to Rename Breaks Under Jaguar
- Subject: Droplet to Rename Breaks Under Jaguar
- From: Marconi <email@hidden>
- Date: Wed, 11 Sep 2002 09:42:52 -0700
To compare my original photos to the cropped versions under Graphic Converter, I have used a script that simply appended "-2" to the cropped versions when they are dropped on the script. This puts them right next to each other when using the folder view of GC.
Anyway, this script worked under 10.1.5 but under Jaguar, it always "unexpectedly quits" the first time it is run and if I subsequently drop the very same group of files on it, it does run, but ever so slowly -- taking 10 seconds or so to rename each dropped file. When I drop the next batch on it, I again get the unexpected quit followed by working slowly the next time. Very strange.
What has changed in Jaguar to cause this?
on open added_items
set the number_of_added_items to the number of the added_items
repeat with q from 1 to the number_of_added_items
set this_added_item to item q of the added_items
-- extract the item name from the file path
set this_item_path to this_added_item as text
set added_item_name to my extract_name_from_path(this_item_path)
try
tell application "Finder"
set name of this_added_item to added_item_name & "-2"
set creator type of this_added_item to "GKON" -- creator to GraphicConverter
set file type of this_added_item to "JPEG"
end tell
end try
end repeat
end open
on extract_name_from_path(this_item_path)
set this_item_path to this_item_path as text
set AppleScript's text item delimiters to ":"
set this_item_name to last item of the text items of this_item_path
set AppleScript's text item delimiters to ""
return this_item_name
end extract_name_from_path
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.