Here is what I am attempting to do:
I have a folder which contains a script and a file. The file is an older copy of a file located in this path: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A.
I am attempting to create an AppleScript that will activate Finder, open the aforementioned path, check if the file in question exists, rename that file to .new if it does, then move the older version from the folder containing the script.
Alternatively, if the AppleScript is run when the .new version of the file exists at the aforementioned path, I would like for the script to rename the older version of the file (which was previously copied) to .old and remove the .new from the original file (i.e., essentially reverse what it did previously, but without removing the file which was added).
No matter what I've tried, I've been, thus far, unable to get the script to authenticate properly to rename the file (the folder in question, obviously, requires administrator approval before any modifications may be made).
Getting the script to activate Finder and open the folder is fairly trivial (e.g., tell application "Finder"
activate
open ("/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A" as POSIX file)
end tell
works just fine), but getting the script to authenticate after that, check for the existence of the file(s), and then act accordingly has been a rather fruitless task.
Any help will be much appreciated.