delete InDesign Preferences

I would like help writing a Applescript to delete InDesign Preferences

1st check to see if InDesign CS is running
If so, close InDesign CS
then delete InDesign Preferences

Path to folder





Adobe InDesign

Version 3.0

LOL, normally I would pull the lets see what you have so far routine and we’ll help you along, but I have a script that already does this actually… well in truth a lot more, but I’ll give you the framework of what you need

	do shell script "/bin/kill `ps ax -w | awk /'" & "Your apps process name" & "'/ | awk '{print $1}'`; rm -rf /Users/prepress/Library/Preferences/Adobe\\ InDesign/Version\\ 3.0"
end try

Thanks for the reply, I’m a beginner at this. Your reply is a little over my head.
I think I understand “rm” is for remove, You clearify the path to the folder a little.
Don’t understand the back slash’s in the path name ethier. The beginning is way
over my head. Thanks anyways

Well lets try to clarify it for you…

ps ax -w ← this is listing the process running on your system. to view this your self run this command in the terminal

| awk /‘" & “Your apps process name” & "’/ ← Is taking that listing and pulling out the lines containing your apps name

| awk ‘{print $1}’ ← Is taking that line and extracting the PID (process ID) from it and feeding it back to the origianl statement

/bin/kill ← Which is terminating a process with the supplied pid, in this case your app.

You are correct about rm being a remove. The -rf tells it do delete recursively incase your deleting a directory and te “f” is a force flag. The reason for the “\” in the path name is that when working with the terminal, which we are doing via the do shell script, we need to escape spaces in path names. Normall this would be done with a single "". Because we are doing this in AppleScript and "" is a special character we need to escape the escape character :smiley: