Dangerous script!

I was playing around with scripting Script Editor and ran the following "innocuous" looking script. Take a look:

set myTest to "tell application " & quote & "finder" & quote & return & "beep" & return & "end tell"
tell application "Script Editor"
make new document with properties {name:"Finder beep", contents:myTest, description:"Just beeps the Finder"}
compile document "Finder beep"
save document "Finder beep" as "application" in "OS X:Users:vince's stuff:desktop:" with run only
quit saving no -- or "yes" or "ask"
end tell

Doesn't look like it can wreak too much havoc, does it? Alas, it does.
If you use file path above without the name of the file (OS X:Users:vangelon:desktop:), the file will replace the desktop folder and everything will be gone!!! You must specify the name of the file after the desktop folder or your desktop folder will be replaced!!!

This will occur WITHOUT a "File already exists" warning dialog!!! Luckily I have strong backup instincts so this was a simple restore of the desktop folder. I'm really glad I didn't save to the top level of the Hard Disk!
🙂
Vince

Posted on Oct 24, 2005 8:03 AM

Reply
16 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Dangerous script!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.