is this possible?
is this possible?
- Subject: is this possible?
- From: Meg Faddick <email@hidden>
- Date: Thu, 31 Jul 2003 09:50:28 -0400
Can AppleScript do this?
I have hundreds of nested folders with a few known text files (XML) in
each which need to have changes made in the text based on two folder
names which correspond to a username (text) and a class year (a
number). The folders (and files) are in each of these two path
structures:
/Students/ClassYear/Username/Library/Preferences/filename.plist
/Students/ClassYear/Username/Library/Prefences/ByHost/filename.plist
I want to:
Drag and drop the Students folder onto a script which:
-Looks for the name of the ClassYear folder and the name of the
Username folder
-Sets variable1 to the Username found by the folder in the above path
named with the Username
-Sets variable2 to the ClassYear found by the folder in the above path
named with the ClassYear
(loop)
-Searches the Preferences/ByHost folder for a known file - FileA
-Searches FileA for one known text string which is always in the same
place, set found string ("/Library/filename.plist") to new string based
on variable1 and variable2
("/Network/Servers/ServerName/Volumes/VolumeName/Students/ClassYear/
Username/Library/Preferences/FolderName/filename.plist")
(-Searches the Preferences/ByHost folder for known FileB, etc, etc ----
end loop)
(loop)
-Searches the Preferences folder for a known file - FileX
-Searches FileX for one known text string which is always in the same
place, set found string ("/Library/filename.plist") to new string based
on variable1 and variable2
("/Network/Servers/ServerName/Volumes/VolumeName/Students/ClassYear/
Username/Library/Preferences/FolderName/filename.plist")
-Searches FileX for one known text string, set found string
("/Library/filename.plist") to new string based on variable1 and
variable2
("/Network/Servers/ServerName/Volumes/VolumeName/Students/ClassYear/
Username/Library/Preferences/FolderName/filename.plist")
(on to known FileY, FileZ, etc, etc --- end loop)
Alternatively, if it made for an easier script to write, I would be
willing to manually set variable2 to each ClassYear and just drag each
ClassYear folder onto the script, letting the script find each username
folder and set it to variable1. I'd have to do this 12 times, but
that's survivable. Doing each file by hand is not!
I'm an OS X Server admin at a K-12 school. I'm new to AppleScript, but
believe it could be the answer to some problems we're experiencing with
property list (.plist) preference files. The files are just XML text,
and thus can be edited in most text editors. I know that BBEdit is
scriptable with a find/replace command in its dictionary and I was
hoping to use it for this purpose.
Any help with this would be tremendously appreciated!
Meg
---------
Meg Faddick
IT Specialist
Bancroft School
508-853-2640 x334
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.