Is there an easier or more elegant way to do this?
Is there an easier or more elegant way to do this?
- Subject: Is there an easier or more elegant way to do this?
- From: Michelle Steiner <email@hidden>
- Date: Sun, 3 Oct 2004 15:22:28 -0700
set foo to choose file with prompt "Which file do you want to move?"
set bar to choose folder with prompt "Which folder do you want to move
it to?"
tell application "Finder"
try
move foo to bar
on error msg number num
if num is -15267 then
set action to button returned of (display dialog msg & return & "Do
you want to replace or rename the file?" buttons {"Cancel", "Replace",
"Rename"} default button 3)
if action is in {"Replace", "Rename"} then
if action is "Rename" then
set temp_answer to foo's name
display dialog "What do you want to rename the file you are
moving?" default answer temp_answer
set foo's name to text returned of the result
end if
move foo to bar with replacing
end if
else
(* handle other errors *)
end if
end try
end tell
--
We're not human beings having a spiritual experience.
We're spiritual beings having a human experience.
_______________________________________________
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