set scriptname to displayed name of (info for (path to me)) as string try set source to do shell script "defaults read " & quoted form of scriptname & " 'Source' " set dest to do shell script "defaults read " & quoted form of scriptname & " 'Dest' " on error -- no such file repeat set sp to POSIX path of (choose folder with prompt "Please select the source directory") set dp to POSIX path of (choose folder with prompt "Please select the destination directory") if sp is dp then display dialog "You cannot choose the same directory for both the source and the destination. Please try again." else do shell script "defaults write " & quoted form of scriptname & " 'Source' " & sp do shell script "defaults write " & quoted form of scriptname & " 'Dest' " & dp exit repeat end if end repeat end try