REVO2700 Plist Editor3 X N--> Plist handlers -- read the plist and process it to show only top level attributes -- no sub-dictionaries or arrays -- function readPlist pFileName put "/usr/libexec/PlistBuddy -c 'Print' '" & pFileName & "'" into tCmd get shell(tCmd) put it into tData -- gets rid of any array or dict names, since the version number settings are all at the top level filter tData without "*{*" filter tData without "*}*" -- now arrays & sub-dicts are indented further -- find out the minimum indent & discard any that are indented more put 999 into tMinIndent repeat for each line L in tData put 0 into tSpaceCount repeat for each char c in L if c = space then add 1 to tSpaceCount else exit repeat end if end repeat if tSpaceCount < tMinIndent then put tSpaceCount into tMinIndent end repeat put empty into tFirstLevel repeat for each line L in tData if L is empty then next repeat if char tMinIndent+1 of L = space then next repeat put char tMinIndent+1 to -1 of L & cr after tFirstLevel end repeat delete last char of tFirstLevel replace " = " with tab in tFirstLevel return tFirstLevel end readPlist -- if the edited plist file is inside an app bundle -- this touches it to refresh the modification date and to make it read the new settings -- command touchApp -- see if the selected plist is inside an app bundle put fld "FileName" into tFileName get offset(".app", tFileName) if it = 0 then exit to top put char 1 to it+3 of tFileName into tAppName put "touch '" & tAppName & "'" into tCmd get shell(tCmd) if the result is not empty then answer error the result end touchApp --> System check -- check compatibility on openStack -- on openStack choose browse tool if the target is me then put isLeopard() into tSysCheck if tSysCheck = false then answer error "Sorry, this will not work on your system." & cr & \ "It requires Mac OS X 10.5 or later." with "Let me look anyway" or "Quit" if it = "Quit" then if the environment = "development" then close this stack else quit end if end if else if tSysCheck = "maybe" then answer warning "This utility has only been tested using Mac OS X 10.5.x" & cr & \ "It may not work on your system." end if end if end openStack -- the location of PlistBuddy is only certain on Leopard -- it may work on systems after 10.5 but will not work before -- function isLeopard if the platform <> "MacOS" then return false put the systemversion into tVers set the itemdel to "." if item 1 of tVers < 10 then return false else if item 2 of tVers < 5 then return false else if item 2 of tVers = 5 then return true else return "maybe" end if end isLeopard " PList Editor UVerdana WVerdanacGlx2TimeStamp checksumjo>'`(҈cRevStandaloneSettings5scriptLibrariesInternet Geometry PrintingMacOSXtrue OSX,name Plist Editor OSX,iconFilePropertyListEditor.icnsMacOS,documentTypeUNIX,fileSelectortrueWindowsfalseMacOS,longVersionPlist Editor 1.0.0.0Windows,LegalCopyright#2008 All rights reserved worldwideUNIX,pageSetuptrueOSX,documentTypeWindows,documenticonFilei/Applications/Revolution Enterprise/3.0.0-gm-2/Runtime/Windows/x86-32/Support/Sample Icons/genericdoc.ico inclusionssearch answerDialogtrueWindows,copyright#2008 All rights reserved worldwideOSX,documentExtensionWindows,FileDescription Plist Editor 1.0.0.0 for WindowsOSX,longVersionPlist Editor 1.0.0.0UNIX,printerChoosertrueOSX,copyright#2008 All rights reserved worldwideWindows,buildU3falseMacOS,shortVersion1.0.0.0MacOS,MinimumSize15000MacOS,versionnumber11MacOS,ReleaseFinalMacOS,versionnumber20MacOS,versionnumber30name Plist EditorOSX,identifiercom..plisteditor MacOS,Region1OSX,shortVersion1.0.0.0Windows,fileversion11Windows,fileversion20Windows,productversion11Windows,fileversion30Windows,productversion20Windows,fileversion40Windows,productversion30cursorsfalse OSX,infoPlist Editor Version 1.0.0.0Windows,productversion40MacOS,dynamicMemorytrueMacOSX PowerPC-32false Windows,UUID$719A2E11-3942-40D1-8050-94CB7EFF82B3 askDialogtrueWindows,iconFilei/Applications/Revolution Enterprise/3.0.0-gm-2/Runtime/Windows/x86-32/Support/Sample Icons/genericapp.icoOSX,signature????Windows,ProductName Plist EditorMacOS,PreferredSize15000UNIX,colorChoosertrueMacOSX x86-32falseMacOS,creator????Windows,companynamecREVGeometryCachestackID1016 cREVGeneralstackfileversion2.7 P--> Resizing on resizeStack pNewW, pNewH changeRect the long name of field "FileName", , , pNewW-100 changeLoc the long name of button "Help", pNewW-53 changeRect the long name of field "PlistData", , 40, pNewW-14, pNewH-40 changeLoc the long name of button "Read plist", 91, pNewH-20 changeLoc the long name of button "Change Version", pNewW div 2, pNewH-20 changeLoc the long name of button "Refresh", pNewW-91, pNewH-20 changeRect the long name of fld "Help", 0, 0, pNewW, pNewH end resizeStack -- changes the rect of the specified object -- send only those parameters you need to change -- leave the others blank. -- the object parameter must be the long name or ID -- on changeRect pObj, newL, newT, newR, newB put the rect of pObj into tRect if newL is not empty then put newL into item 1 of tRect if newT is not empty then put newT into item 2 of tRect if newR is not empty then put newR into item 3 of tRect if newB is not empty then put newB into item 4 of tRect set the rect of pObj to tRect end changeRect -- changes the loc of the specified object -- send only those parameters you need to change -- leave the others blank. -- the object parameter must be the long name or ID -- on changeLoc pObj, newL, newT put the loc of pObj into tLoc if newL is not empty then put newL into item 1 of tLoc if newT is not empty then put newT into item 2 of tLoc set the loc of pObj to tLoc end changeLoc --> Clean up on cleanUp put empty into fld "FileName" put empty into fld "PlistData" end cleanUp on closeStackRequest cleanUp save this stack pass closeStackRequest end closeStackRequest " cGlx2GeneralcScriptChecksumcExplicitVariablescHscrollScript0cLocalscHscrollHandlers0 cHtmlScriptTMs0+v8z%3,kPb$ՒI}w6ϐ @$v2X5{P|5 +)aPYRcU3P$<-^]*>ܪDw5?() pLHd=b X{mM_ gKMh=ܜs 'NH Yͬÿ\S #sgkWUlGɀ 3 ²JHHf3}u#k*ZZ0( e@bt) =.puh>b4n"6Ǧv=]GLO; YN1DWH!wc:w all handlers on mouseDoubleUp -- check that a file has been loaded and still exists put fld "FileName" into tFileName if tFileName is empty or there is not a file tFileName then beep answer error "Please load a valid plist file before editing!" exit to top end if -- extract the selected data put the hilitedline of me into tLineNum put line tLineNum of me into tLineData set the itemdel to tab put item 1 of tLineData into tListName put item 2 of tLineData into tListData -- get the changed data ask info "Enter the new data for" & cr & tListName with tListData put it into tNewData if the result = "Cancel" then exit to top if tNewData = tListData then exit to top -- no need to save -- use the shell command to save the new data put "/usr/libexec/PlistBuddy -c 'Set :" & tListName && tNewData & "' '" & tFileName & "'" into tCmd get shell(tCmd) if it = empty then -- if the change worked, update the display & touch the app to update it put tNewData into item 2 of line tLineNum of me touchApp else answer error it end if end mouseDoubleUp ff@(cGlx2TimeStamp checksumbUƀ}<(h%T cREVGeneral revUniqueID 1223429416271  `)ж Read plistE--> all handlers on mouseUp answer file "Select an app or plist file to read:" with fld "FileName" put it into tFileName if tFileName is empty then exit to top if char -4 to -1 of tFileName = ".app" then put "/Contents/Info.plist" after tFileName if there is not a file tFileName then answer error "That app does not have an Info.plist file!" exit to top end if end if if tFileName contains ".plist" is false then answer error "That is not a plist file!" exit to top end if put tFileName into fld "FileName" put readPlist(tFileName) into fld "PlistData" end mouseUp 0cGlx2TimeStamp checksumq -S yVK|$) cREVGeneral revUniqueID 1223429423396  FileName `@ lcGlx2TimeStamp checksum cREVGeneral revUniqueID 1223431314714  Change VersionEh--> all handlers -- this finds the 3 version number entries in a standard Info.plist file and edits them all at once -- on mouseUp -- check the file name put fld "FileName" into tFileName if tFileName is empty or there is not a file tFileName then beep answer error "Please load a valid plist file before editing!" exit to top end if -- find existing short version put fld "PlistData" into tPlist get lineoffset("CFBundleShortVersionString", tPlist) put line it of tPlist into tShortVersion set the itemdel to tab put item 2 of tShortVersion into tShortVersion ask info "Please enter the new version number:" with tShortVersion put it into tNewVersion if tNewVersion is empty or tNewVersion = tShortVersion then exit to top -- 3 sections to change put "CFBundleGetInfoString,CFBundleShortVersionString,CFBundleLongVersionString" into tHeaders replace comma with tab in tHeaders repeat for each item i in tHeaders put lineoffset(i, tPlist) into tLineNum if tLineNum = 0 then next repeat put item 2 of line tLineNum of tPlist into tData replace tShortVersion with tNewVersion in tData put "/usr/libexec/PlistBuddy -c 'Set :" & i && tData & "' '" & tFileName & "'" into tCmd get shell(tCmd) if it = empty then put tData into item 2 of line tLineNum of fld "PlistData" else answer error it exit to top end if end repeat -- update the app bundle to show the new settings touchApp end mouseUp "4cGlx2TimeStamp checksumbdF ,5| cREVGeneral revUniqueID 1223437044095 RefreshE'--> all handlers -- refreshes the display to show the current contents of the selected plist file -- on mouseUp put fld "FileName" into tFileName if tFileName is empty or there is not a file tFileName then exit to top put readPlist(tFileName) into fld "PlistData" end mouseUp 62cGlx2TimeStamp checksumC5Q'tyB cREVGeneral revUniqueID 1223437766674 HelpE--> all handlers on mouseUp set the rect of fld "Help" to the rect of this card set the visible of fld "Help" to not the visible of fld "Help" end mouseUp  M2cGlx2TimeStamp checksumi휭x_[' cREVGeneral revUniqueID 1246254708846 Helpp6--> all handlers on mouseUp hide me end mouseUp @"cGlx2TimeStamp checksum;f C cREVGeneral revUniqueID 1246254787572  RThis utility reads some of the data from an OS X's application's plist.info file. YThis is sufficient to determine the current version number and to change it as required. g1. Click 'Read plist" and select your application or a plist file. The data will be displayed for you. <2. Click 'Change Version' and enter the new version number. pWhen you enter a new version number, hte info.plist file will be edited and the application bundle will be "touched' to update it's modification date. Often this is enough to update the version number shown when you 'Get Info' but sometimes it will still display the old version number. If so, you can duplicate the app bundle, or zip & un-zip it, to force an update. Notes: `- This utility uses the PlistBuddy shell command to read from and write to the info.plist file. - Not all of the data from the info.plist file is displayed, as this utility does not need to burrow down into the sub-arrays and dictionaries. x- This has been tested on Mac OS X 10.5.x only. It may work on older versions of Mac OS X but I can't say that it will. Use at your own risk. Click to hide this help... `