What is the best way of creating a script such that when done it deletes itself?
I’m planning on copying a scirpt to currently logged in user’s desktop and after pefroming its task I’d like for the script to delete itself. The command to delete will also have to be profile/user independent since the script will be pushed to different machines.
The script will be modifying Entourage account settings.
Would this be the best way of going about this?
Would there be a better place than Desktop?
I’m a novice at this and so far this is what I’ve come up with for deleting script which does not work.
tell application “Finder”
delete file “script_name” of folder “Desktop” of folder “user n” of startup disk
end tell
In both cases, my scripts work if the script is saved as an application AND run by double-clicking it on the Desktop. They return the error you describe if run by clicking on the Run button in the Script Editor.