Avoiding a stupid mistake

Graham Samuel livfoss at mac.com
Sun May 22 11:31:28 EDT 2016

Just for general interest -

I wanted to delete the Preferences folder for an app I’m working on, so I scripted a button as follows:

   get specialFolderPath("preferences")
   revdeletefolder it 

What I’d forgotten was that on the Mac version, my preferences were not in a folder dedicated to my app, but just stored in a folder called ‘Preferences’ with all the preferences of all other apps for my whole library! So the result of pressing this button was to delete all the preferences from the machine! Luckily Time Machine came to my aid… but the point is, nothing stopped my script from executing.

Of course nobody else would be dumb enough to do this, but just in case…


More information about the Use-livecode mailing list