Hello Ken and thanks again. I am already using a script to locate
copies of FileBuddy and so far it seems to work on the few machines
I've tested. But thanks for suggesting it because it was dumb luck I
ran across this script.
put "find /Library/Receipts -name *PlistBuddy" into tFindScript
put shell(tFindScript) into tPlistBuddyList
I then figure out which has the most recent creation date and go
with that one.
My fixPath() routine doesn't take all the same characters into
account.... I'll be using yours!
Scott Morrow
Elementary Software
(Now with 20% less chalk dust!)
web http://elementarysoftware.com/
email [EMAIL PROTECTED]
On Jul 23, 2008, at 9:31 AM, Ken Ray wrote:
Thanks a bunch. I didn't know about PlistBuddy. I've got it working
now!
BTW: If this is going to be a commercial app, you may want to insure
against
the possibility that PlistBuddy isn't in the place you think it is
(I've had
that happen when going from Tiger (where it was in the
AdditionalEssentials.pkg receipt file) to Leopard (where it ended up
in
/usr/libexec)). Here's a handy handler I wrote just in case... feel
free to
use any or all of it (watch line wraps):
function stsFindPListBuddy
-- Attempts to locate PlistBuddy by some known paths first, and
-- then uses "locate" if it can't find it. PlistBuddy is installed
with a
-- lot of software so it should always be there.
put "/usr/libexec/PlistBuddy" & cr & "/Library/Receipts/
AdditionalEssentials.pkg/Contents/Resources/PlistBuddy" into
tKnownLocs
repeat for each line tLoc in tKnownLocs
if there is a file tLoc then return tLoc
end repeat
put shell("/usr/bin/locate PlistBuddy | sed 2,10000d") into tLoc
put word 1 to -1 of tLoc into tLoc
return fixPath(tLoc) -- Just in case of spaces, etc.
end stsFindPListBuddy
function fixPath pPath
put "\" & space & quote & "'`<>!;()[]?#$^&*=" into tSpecialChars
repeat for each char tChar in tSpecialChars
replace tChar with ("\" & tChar) in pPath
end repeat
return pPath
end fixPath
Enjoy!
Ken Ray
Sons of Thunder Software, Inc.
Email: [EMAIL PROTECTED]
Web Site: http://www.sonsothunder.com/
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution