Removing an OSX dock icon

Ken Ray kray at sonsothunder.com
Wed Jul 23 12:31:11 EDT 2008



> 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: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the use-livecode mailing list