I don’t usually use applescript for user interactions. My advice: don’t ask the user to locate the file each time the move command fails, instead when a file isn’t located (that is, the “move” fails), write the name of the missing file to another file. When all the processing is done, show the list of failures to the user, then let the user decide what to do about the missing files. Now why: if the list of files to be moved is long enough, the user must sit at the computer waiting for it to present the “file not found” dialog box. (Adding “giving up after” to the dialog command will slow things down.)
But if you want to ask the user about every failure when it happens… your task is more difficult than you think (with plain applescript). You’ll need a “try… on error” block everywhere the user might click the “cancel” button (for example, in the file selection dialog box).
Also there is this:
make new folder in disk "Apps"
select folder "untitled folder" in disk "Apps"
set name of selection to myvendor
select folder myvendor in disk "Apps"
select folder myvendor in disk "Apps"
make new folder in folder myvendor in disk "Apps"
select folder "untitled folder" in folder myvendor in disk "Apps"
set name of selection to formnum
will work better if you use
set myvendor to "test vendor name"
set myform "to test form name"
tell application "Finder" to set vendor_folder to make new folder at disk "Apps" with properties {name:myvendor}
vendor_folder -- returns folder "testvendorname" of disk "Apps" of application "Finder"
tell app "Finder" to set form_folder to make new folder at vendor_folder with properties {name:myform}
There is no need to select an item prior to moving. Simply instruction the Finder to move it. If the user accidently clicks the mouse, the selection is lost and your script is lost, too.
It’s difficult for me to understand exactly what you want, so if the following doesn’t make sense, forgive me. Note also this is psuedocode, not applescript. It’s only for structure
set file_list to list of files that need to be moved
repeat with one_file in file_list
try
move file from wrong_location to right_location
on error
display dialog "file missing" & name of file with buttons "hunt for it" "forget it"
if button is hunt for it then
try
choose file
set wrong_location to chosen file
move file from wrong_location to right_location
on error --user canceled
do something or not, depending on what you need
end try
end if
-- if selection is "forget it", the repeat loop will continue with the next item
-- if the selection is "hunt for it" the repeat loop will continue with the next item
-- regardless of whether the user found the file, couldn't find the file, or cancelled
end try
end repeat