• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Is there an easier or more elegant way to do this?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Is there an easier or more elegant way to do this?
      • From: "John C. Welch" <email@hidden>
  • Prev by Date: Re: Variable Ponderance
  • Next by Date: Re: Is there an easier or more elegant way to do this?
  • Previous by thread: Re: Quark 6 Doc File Path = Temporary Items?
  • Next by thread: Re: Is there an easier or more elegant way to do this?
  • Index(es):
    • Date
    • Thread