Hello! First post here.
I need to have a script that would delete a bunch of app’s plist files. However, one of them (version 12) has a slightly different domain name due to the old company name. And if iterate over it with the repeat command, it wouldn’t skip over “12” and still use this value to look for and delete a newcompanyname plist. How do I exclude it from iterating it in the list of app versions?
on run
set appVersionList to {"12", "13", "14", "15", "16"}
--choice: reset preferences
set resetChoice to (display dialog "Reset application preferences?" buttons {"Reset", "Cancel"} default button "Reset")
if button returned of resetChoice is "Reset" then
tell application ("App Name ")
quit
end tell
delay 3
repeat with appVersion in appVersionList
if appVersion is equal to "12" then
do shell script "defaults delete com.oldcompanyname.appname" & appVersion & ""
else
set appVersionList to {"13", "14", "15", "16"}
do shell script "defaults delete com.newcompanyname.appname" & appVersion & ""
end if
end repeat
end if
end run