Deleting preference files in the Classic system folder

hi all, applescript newb here…

i need a script to delete the preferences file (actually a folder) in the classic system folder.

the path will always be usersHDname/classic/System Folder/Preferences/filename

upon script launch, it would delete said file and then open the app.

thx for the help!

Here you go. Change the path to your folder in the preferences… always use : instead of / & change Your_App to the app you want to open.


Tell application "Finder" to delete folder(*usersHDname*:classic:System Folder:Preferences:*foldername*)
tell application "*Your_App*" to activate
quit

This will delete the folder of your choice and then activate your app. I assume you want this script so that you dont have to delete the pref folder every time you run the app. To use it that way, save the script as an application and from now on when you want to run that app, double click this script app and it will do it’s thing.
Now aint that easy,
JO

thanks for the reply

one question: is there a way to have a wild card or something so i don’t need a different script for each machine? or just make sure all their hd’s are named the same, like ‘macintosh hd’… same with the path to the app

ok i am a complete newb to applescript and got syntax errors all around with this code - of the many things it doesn’t like, is the space in ‘macintosh hd’, and the “:” that seperate the path

using script editor in panther

The path to the application doesn’t matter, just enter the correct name, and the Finder will do his thing. I have changed the previous script to comply with all you wanted.

When you open it in Script Editor, replace “YourFolder” with the correct name for the folder, and “YourApp” with the name for the application. Then save this script as an application (executable only) and you’re done.

Hope this helps.

ok cool - i was messing with the first script, and while i could get it to do everything, once the classic app opened (and subsequently waited for an appropriate choice in the immediate dialog box it displayed), it would lock up

with the second script everything works fine. question: is osX applescript capable of navigating through classic app dialog boxes? or is this up to the user to do?

thx a lot everyone

as far as I am aware, that sort of scripting isn’t built into the Classic OS, and is only available in Panther to OS X-native apps.

What dialogs/buttons, exactly, are you encountering?

oh just a dialog where you specify the server to connect to - choices with an ‘ok’ and ‘cancel’ button

hmmmm …

since i can’t see the whole script, i don’t know all of what’s going on, but maybe this could work:

tell app "Finder"
     mount volume "afp://username:password@server_name"
end tell

this may not even be relevant to what you need, but i thought i’d throw it out there.