Re: Removable Disks (wrapping code)
Re: Removable Disks (wrapping code)
- Subject: Re: Removable Disks (wrapping code)
- From: email@hidden (Christopher Rosado)
- Date: Mon, 10 Nov 2003 12:48:30 -0500
Hi Jay-
Your code worked out really well-thanks! I've been working on
comprehending what you have sent and have a few questions.
on removableVolume(pics)
set desktopPath to (path to desktop) as string
Is (pics) a container for removableVolume? I haven't run across syntax
like this and am guessing...
repeat with x in pics
with timeout of 600 seconds
try
move disk x's items to folder (desktopPath & newFolderName)
I'm not clear on "repeat with x in pics" nor am I with "move disk x's
items...." I understand that this portion of the code copies from
removable device to folder on the desktop but beyond that I'm unsure.
The script works well for copying contents of a removable volume to a
designated folder. With a Compact Flash card, the path to image files
is removable volume:CDIM:100CANON. I'd like the script to copy only the
image files (JPEGs, TIFFs).
The problem is that the folder 100CANON isn't always named as such. It
could be 101CANON, 102CANON, etc. There is another folder that is
consistently named on the same level as 100CANON- "CANONMSC".
How would I consistently point this script to these image files? Better
yet, is there a way to search this volume for JPEGs and TIFFs? If so,
this would allow the script to handle any removable volume with image
files.
Below is what I've assembled so far.....
--Christopher
----------------------------------------------------------------
on idle {}
tell application "Finder"
tell (disks whose ejectable is true)
if it exists then my removableVolume(it's name)
end tell
end tell
return 5
end idle
on removableVolume(pics)
set desktopPath to (path to desktop) as string
if month of (current date) is January then set newMonth to "01"
if month of (current date) is February then set newMonth to "02"
if month of (current date) is March then set newMonth to "03"
if month of (current date) is April then set newMonth to "04"
if month of (current date) is May then set newMonth to "05"
if month of (current date) is June then set newMonth to "06"
if month of (current date) is July then set newMonth to "07"
if month of (current date) is August then set newMonth to "08"
if month of (current date) is September then set newMonth to "09"
if month of (current date) is October then set newMonth to "10"
if month of (current date) is November then set newMonth to "11"
if month of (current date) is December then set newMonth to "12"
set convertDay to day of (current date)
if (convertDay) < (10) then
set newDay to (0 & convertDay as text)
else
set newDay to convertDay
end if
set newYear to year of (current date)
set newFolderName to {newYear & "-" & newMonth & "-" & newDay as text}
tell application "Finder"
if not (exists (folder (desktopPath & newFolderName))) then
make new folder at folder desktopPath with properties
{name:newFolderName}
end if
repeat with x in pics
with timeout of 600 seconds
try
move disk x's items to folder (desktopPath & newFolderName)
on error the error_message number the error_number
display dialog "Error: " & the error_number & ". " & the
error_message buttons {"OK"} default button 1
end try
end timeout
eject disk x
end repeat
end tell
end removableVolume
_______________________________________________
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.