Changeset 74 for trunk/lingosource
- Timestamp:
- 12/06/07 23:17:27 (4 years ago)
- Location:
- trunk/lingosource
- Files:
-
- 2 added
- 9 edited
-
castlib1/OSCmenu_Utilities.ls (modified) (24 diffs)
-
castlib1/alexUtilities.ls (modified) (7 diffs)
-
castlib1/bbedit_Utilities.ls (added)
-
castlib1/convert_Lingo_2_CSS_Html.ls (modified) (1 diff)
-
castlib1/memberInfo.xml (modified) (18 diffs)
-
castlib1/svn_Utilities.ls (added)
-
castlib2/FileIOFunktionen.ls (modified) (6 diffs)
-
castlib2/GetSetPrefs.ls (modified) (2 diffs)
-
castlib2/PseudoXMLPS.ls (modified) (6 diffs)
-
castlib2/commonMovieScript.ls (modified) (3 diffs)
-
castlib2/memberInfo.xml (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/OSCmenu_Utilities.ls
r63 r74 22 22 23 23 subli.add("Insert current date") 24 pLookUpCommandList.setaprop("Insert current date", "pasteDate me")24 pLookUpCommandList.setaprop("Insert current date", ["pasteDate me", "alexUtilities"]) 25 25 26 26 subli.add("Insert divider") 27 pLookUpCommandList.setaprop("Insert divider", "pasteDivider me")27 pLookUpCommandList.setaprop("Insert divider", ["pasteDivider me", "alexUtilities"]) 28 28 29 29 li.add("") … … 36 36 37 37 subli.add("Edit in BBEdit") 38 pLookUpCommandList.setaprop("Edit in BBEdit", "mOpen_text_with_BBedit me")38 pLookUpCommandList.setaprop("Edit in BBEdit", ["mOpen_text_with_BBedit me", "bbedit_Utilities"]) 39 39 40 40 subli.add("Open linked script") 41 pLookUpCommandList.setaprop("Open linked script", "mOpen_Linked_Script_With_BBedit me")41 pLookUpCommandList.setaprop("Open linked script", ["mOpen_Linked_Script_With_BBedit me", "bbedit_Utilities"]) 42 42 43 43 subli.add("Diff selected script") 44 pLookUpCommandList.setaprop("Diff selected script", "mBBDiff_LiveCompare_SelectedScript me")44 pLookUpCommandList.setaprop("Diff selected script", ["mBBDiff_LiveCompare_SelectedScript me", "bbedit_Utilities"]) 45 45 46 46 subli.add("Batch compare selected scripts") 47 pLookUpCommandList.setaprop("Batch compare selected scripts", "mCompareSelectedScriptmembersBatch me")47 pLookUpCommandList.setaprop("Batch compare selected scripts", ["mCompareSelectedScriptmembersBatch me", "bbedit_Utilities"]) 48 48 49 49 end if … … 56 56 57 57 subli.add("Choose file...") 58 pLookUpCommandList.setaprop("Choose file...", "mGetFilePathFromUser me")58 pLookUpCommandList.setaprop("Choose file...", ["mGetFilePathFromUser me", "alexUtilities"]) 59 59 60 60 subli.add("Choose folder...") 61 pLookUpCommandList.setaprop("Choose folder...", "mGetFolderPathFromUser me")61 pLookUpCommandList.setaprop("Choose folder...", ["mGetFolderPathFromUser me", "alexUtilities"]) 62 62 63 63 subli.add("Read text from file...") 64 pLookUpCommandList.setaprop("Read text from file...", "mGetTextFromFile me, filepath_optional")64 pLookUpCommandList.setaprop("Read text from file...", ["mGetTextFromFile me, filepath_optional", "alexUtilities"]) 65 65 66 66 subli.add("Get file list from folder...") 67 pLookUpCommandList.setaprop("Get file list from folder...", "mGetFileList me, folderpath_optional")67 pLookUpCommandList.setaprop("Get file list from folder...", ["mGetFileList me, folderpath_optional", "alexUtilities"]) 68 68 69 69 subli.add("Get folder list from folder...") 70 pLookUpCommandList.setaprop("Get folder list from folder...", "mGetFolderList me, folderpath_optional")70 pLookUpCommandList.setaprop("Get folder list from folder...", ["mGetFolderList me, folderpath_optional", "alexUtilities"]) 71 71 72 72 … … 77 77 78 78 subli.add("Read XML file...") 79 pLookUpCommandList.setaprop("Read XML file...", "mReadXML_2_List me")79 pLookUpCommandList.setaprop("Read XML file...", ["mReadXML_2_List me", "alexUtilities"]) 80 80 81 81 subli.add("Export list to XML file...") 82 pLookUpCommandList.setaprop("Export list to XML file...", "mSaveList_2_XML me, theList")82 pLookUpCommandList.setaprop("Export list to XML file...", ["mSaveList_2_XML me, theList", "alexUtilities"]) 83 83 84 84 … … 89 89 90 90 subli.add("Convert to bitmap") 91 pLookUpCommandList.setaprop("Convert to bitmap", "mConvertToBitmap me")91 pLookUpCommandList.setaprop("Convert to bitmap", ["mConvertToBitmap me", "alexUtilities"]) 92 92 93 93 … … 98 98 99 99 subli.add("Find in GPDL...") 100 pLookUpCommandList.setaprop("Find in GPDL...", "mFindInGPDL me, str_optional")100 pLookUpCommandList.setaprop("Find in GPDL...", ["mFindInGPDL me, str_optional", "alexUtilities"]) 101 101 102 102 subli.add("Select member in score...") 103 pLookUpCommandList.setaprop("Select member in score...", "mSelectInScore me, startframe_optional, endframe_optional")103 pLookUpCommandList.setaprop("Select member in score...", ["mSelectInScore me, startframe_optional, endframe_optional", "alexUtilities"]) 104 104 105 105 li.add("") … … 112 112 113 113 subli.add("Unlink bitmap members") 114 pLookUpCommandList.setaprop("Unlink bitmap members", "mUnlinkBitmaps me")114 pLookUpCommandList.setaprop("Unlink bitmap members", ["mUnlinkBitmaps me", "alexUtilities"]) 115 115 116 116 subli.add("") 117 117 subli.add("Link selected text...") 118 pLookUpCommandList.setaprop("Link selected text...", "mLinkSelectedText me")118 pLookUpCommandList.setaprop("Link selected text...", ["mLinkSelectedText me", "alexUtilities"]) 119 119 120 120 subli.add("Update all linked texts") 121 pLookUpCommandList.setaprop("Update all linked texts", "mUpdateAllLinkedTexts me")121 pLookUpCommandList.setaprop("Update all linked texts", ["mUpdateAllLinkedTexts me", "alexUtilities"]) 122 122 123 123 … … 128 128 129 129 subli.add("Export selcetd text as...") 130 pLookUpCommandList.setaprop("Export selcetd text as...", "mExportSelectedText me, theType_optional")130 pLookUpCommandList.setaprop("Export selcetd text as...", ["mExportSelectedText me, theType_optional", "alexUtilities"]) 131 131 132 132 subli.add("") 133 133 subli.add("Export selected bitmaps...") 134 pLookUpCommandList.setaprop("Export selected bitmaps...", "mExportSelectedBMs me, theType_optional, compr_optional, thePath_optional")134 pLookUpCommandList.setaprop("Export selected bitmaps...", ["mExportSelectedBMs me, theType_optional, compr_optional, thePath_optional", "alexUtilities"]) 135 135 136 136 subli.add("Export to bitmap...") 137 pLookUpCommandList.setaprop("Export to bitmap...", "mExportBM me, theMember, thePath_optional, theType_optional, compr_optional")137 pLookUpCommandList.setaprop("Export to bitmap...", ["mExportBM me, theMember, thePath_optional, theType_optional, compr_optional", "alexUtilities"]) 138 138 139 139 … … 145 145 146 146 subli.add("Delete Members By Name...") 147 pLookUpCommandList.setaprop("Delete Members By Name...", "mDeleteMembersByName me, startString")147 pLookUpCommandList.setaprop("Delete Members By Name...", ["mDeleteMembersByName me, startString", "alexUtilities"]) 148 148 149 149 subli.add("") 150 150 subli.add("Name Members...") 151 pLookUpCommandList.setaprop("Name Members...", "mNameMemberNames me, newName")151 pLookUpCommandList.setaprop("Name Members...", ["mNameMemberNames me, newName", "alexUtilities"]) 152 152 153 153 subli.add("Prefix/Suffix Names...") 154 pLookUpCommandList.setaprop("Prefix/Suffix Names...", "mChangeMemName me, praefix, suffix")154 pLookUpCommandList.setaprop("Prefix/Suffix Names...", ["mChangeMemName me, praefix, suffix", "alexUtilities"]) 155 155 156 156 subli.add("Make numbered names...") 157 pLookUpCommandList.setaprop("Make numbered names...", "mNumberMemberNames me, numberOfDigits, startnum, theDelimiter, stepSize")157 pLookUpCommandList.setaprop("Make numbered names...", ["mNumberMemberNames me, numberOfDigits, startnum, theDelimiter, stepSize", "alexUtilities"]) 158 158 159 159 subli.add("Replace in name...") 160 pLookUpCommandList.setaprop("Replace in name...", "mReplaceInMemName me, searchstr, replacestring")160 pLookUpCommandList.setaprop("Replace in name...", ["mReplaceInMemName me, searchstr, replacestring", "alexUtilities"]) 161 161 162 162 subli.add("") 163 163 subli.add("Fill empty castslots with dummy members") 164 pLookUpCommandList.setaprop("Fill empty castslots with dummy members", "mFillDummyMember me")164 pLookUpCommandList.setaprop("Fill empty castslots with dummy members", ["mFillDummyMember me", "alexUtilities"]) 165 165 166 166 subli.add("Erase dummy members") 167 pLookUpCommandList.setaprop("Erase dummy members", "mRemoveDummyMember me")167 pLookUpCommandList.setaprop("Erase dummy members", ["mRemoveDummyMember me", "alexUtilities"]) 168 168 169 169 … … 177 177 178 178 subli.add("Put script stats") 179 pLookUpCommandList.setaprop("Put script stats", "GetScriptlines me")179 pLookUpCommandList.setaprop("Put script stats", ["GetScriptlines me", "alexUtilities"]) 180 180 181 181 subli.add("Find all Puts") 182 pLookUpCommandList.setaprop("Find all Puts", "mListallPuts me")182 pLookUpCommandList.setaprop("Find all Puts", ["mListallPuts me", "alexUtilities"]) 183 183 184 184 … … 189 189 190 190 subli.add("Lingo help...") 191 pLookUpCommandList.setaprop("Lingo help...", "mGetHelp me, theText")191 pLookUpCommandList.setaprop("Lingo help...", ["mGetHelp me, theText", "alexUtilities"]) 192 192 193 193 subli.add("Create help files from selected members") 194 pLookUpCommandList.setaprop("Create help files from selected members", "makeHelpEntries me")194 pLookUpCommandList.setaprop("Create help files from selected members", ["makeHelpEntries me", "alexUtilities"]) 195 195 196 196 subli.add("Create members for help files from selected script") 197 pLookUpCommandList.setaprop("Create members for help files from selected script", "makeHelpFilesFromScript me, memref_optional, onlyHandlerWithComments_optional")197 pLookUpCommandList.setaprop("Create members for help files from selected script", ["makeHelpFilesFromScript me, memref_optional, onlyHandlerWithComments_optional", "alexUtilities"]) 198 198 199 199 … … 205 205 subli = [] 206 206 li.add(subli) 207 subli.add("mLinkScripts me") 208 subli.add("mUnLinkScripts me") 209 subli.add("mUnLinkAllScripts me") 207 subli.add("Link selected alex-linked-library-scripts") 208 pLookUpCommandList.setaprop("Link selected alex-linked-library-scripts", ["mLinkScripts me", "bbedit_Utilities"]) 209 210 subli.add("UnLink selected alex-linked-library-scripts") 211 pLookUpCommandList.setaprop("UnLink selected alex-linked-library-scripts", ["mUnLinkScripts me", "bbedit_Utilities"]) 212 213 subli.add("UnLink all alex-linked-library-scripts") 214 pLookUpCommandList.setaprop("UnLink all alex-linked-library-scripts", ["mUnLinkAllScripts me", "bbedit_Utilities"]) 215 210 216 subli.add("") 211 subli.add("mBBedit me") 212 subli.add("mCheckLSChange me") 217 subli.add("Open original of selected alex-linked-library-script in BBEdit") 218 pLookUpCommandList.setaprop("Open original of selected alex-linked-library-script in BBEdit", ["mBBedit me", "bbedit_Utilities"]) 219 220 subli.add("Check changes in selected alex-linked-library-scripts") 221 pLookUpCommandList.setaprop("Check changes in selected alex-linked-library-scripts", ["mCheckLSChange me", "bbedit_Utilities"]) 222 213 223 subli.add("") 214 subli.add("mRefreshScripts me") 224 subli.add("Refresh selected alex-linked-library-scripts") 225 pLookUpCommandList.setaprop("Refresh selected alex-linked-library-scripts", ["mRefreshScripts me", "bbedit_Utilities"]) 226 215 227 subli.add("") 216 subli.add("mExportListOfUsedLinkedScripts me") 228 subli.add("Export a list of used alex-linked-library-scripts") 229 pLookUpCommandList.setaprop("Export a list of used alex-linked-library-scripts", ["mExportListOfUsedLinkedScripts me", "bbedit_Utilities"]) 217 230 218 231 … … 223 236 li.add(subli) 224 237 subli.add("Compare selected scripts with Working Copy...") 225 pLookUpCommandList.setaprop("Compare selected scripts with Working Copy...", "mCompareCurrentScriptToWorkingCopy me, convertLineBreaksToUnix")238 pLookUpCommandList.setaprop("Compare selected scripts with Working Copy...", ["mCompareCurrentScriptToWorkingCopy me, convertLineBreaksToUnix", "svn_Utilities"]) 226 239 227 240 subli.add("Export selected script to Working Copy and Open...") 228 pLookUpCommandList.setaprop("Export selected script to Working Copy and Open...", "mExportCurrentScriptToWorkingCopyAndOpen me, convertLineBreaksToUnix")241 pLookUpCommandList.setaprop("Export selected script to Working Copy and Open...", ["mExportCurrentScriptToWorkingCopyAndOpen me, convertLineBreaksToUnix", "svn_Utilities"]) 229 242 230 243 … … 241 254 svn_subli.add(subli) 242 255 subli.add("Export scripts to SVN working copy...") 243 pLookUpCommandList.setaprop("Export scripts to SVN working copy...", "mExportScriptsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional")256 pLookUpCommandList.setaprop("Export scripts to SVN working copy...", ["mExportScriptsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional", "svn_Utilities"]) 244 257 245 258 subli.add("Import script from file...") 246 pLookUpCommandList.setaprop("Import script from file...", "mImportScriptWithThumbnail me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional")259 pLookUpCommandList.setaprop("Import script from file...", ["mImportScriptWithThumbnail me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional", "svn_Utilities"]) 247 260 248 261 subli.add("") 249 262 subli.add("SVN Update ScriptText in Working Copy...") 250 pLookUpCommandList.setaprop("SVN Update ScriptText in Working Copy...", "mSVN_Update_Working_Copy_ScriptText me, chooseNewPath_optional")263 pLookUpCommandList.setaprop("SVN Update ScriptText in Working Copy...", ["mSVN_Update_Working_Copy_ScriptText me, chooseNewPath_optional", "svn_Utilities"]) 251 264 252 265 subli.add("") 253 266 subli.add("SVN Import Scripts, Text and Fields from working copy...") 254 pLookUpCommandList.setaprop("SVN Import Scripts, Text and Fields from working copy...", "mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional")267 pLookUpCommandList.setaprop("SVN Import Scripts, Text and Fields from working copy...", ["mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional", "svn_Utilities"]) 255 268 256 269 257 270 subli.add("") 258 271 subli.add("SVN Commit ScriptText only...") 259 pLookUpCommandList.setaprop("SVN Commit ScriptText only...", "mSVN_Commit_CurrentScripts_ScriptText me, selected_Members_Only_optional")272 pLookUpCommandList.setaprop("SVN Commit ScriptText only...", ["mSVN_Commit_CurrentScripts_ScriptText me, selected_Members_Only_optional", "svn_Utilities"]) 260 273 261 274 subli.add("") 262 275 subli.add("SVN Delete Selected Scripts...") 263 pLookUpCommandList.setaprop("SVN Delete Selected Scripts...", "mSVN_Delete_Selected_Scripts me, chooseNewPath_optional")276 pLookUpCommandList.setaprop("SVN Delete Selected Scripts...", ["mSVN_Delete_Selected_Scripts me, chooseNewPath_optional", "svn_Utilities"]) 264 277 265 278 … … 273 286 274 287 subli.add("Export text members to SVN working copy...") 275 pLookUpCommandList.setaprop("Export text members to SVN working copy...", "mExportTextAndFieldsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional")288 pLookUpCommandList.setaprop("Export text members to SVN working copy...", ["mExportTextAndFieldsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional", "svn_Utilities"]) 276 289 277 290 subli.add("Import text from SVN working copy...") 278 pLookUpCommandList.setaprop("Import text from SVN working copy...", "mImportTextAndFields me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional")291 pLookUpCommandList.setaprop("Import text from SVN working copy...", ["mImportTextAndFields me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional", "svn_Utilities"]) 279 292 280 293 subli.add("") 281 294 subli.add("SVN Import Scripts, Text and Fields from working copy...") 282 pLookUpCommandList.setaprop("SVN Import Scripts, Text and Fields from working copy...", "mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional")295 pLookUpCommandList.setaprop("SVN Import Scripts, Text and Fields from working copy...", ["mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional", "alexUtilities"]) 283 296 284 297 … … 292 305 293 306 subli.add("SVN Update selected castlib...") 294 pLookUpCommandList.setaprop("SVN Update selected castlib...", "mSVN_Update_SelectedCastlib me, chooseNewPath_optional, onlyUpdate_SVN_WorkingFolder_optional")307 pLookUpCommandList.setaprop("SVN Update selected castlib...", ["mSVN_Update_SelectedCastlib me, chooseNewPath_optional, onlyUpdate_SVN_WorkingFolder_optional", "svn_Utilities"]) 295 308 296 309 subli.add("SVN Update Current Movie...") 297 pLookUpCommandList.setaprop("SVN Update Current Movie...", "mSVN_Update_CurrentMovie_Binaries me, chooseNewPath_optional, onlyUpdate_SVN_WorkingFolder_optional")310 pLookUpCommandList.setaprop("SVN Update Current Movie...", ["mSVN_Update_CurrentMovie_Binaries me, chooseNewPath_optional, onlyUpdate_SVN_WorkingFolder_optional", "svn_Utilities"]) 298 311 299 312 subli.add("") 300 313 subli.add("SVN Commit selected castlib...") 301 pLookUpCommandList.setaprop("SVN Commit selected castlib...", "mSVN_Commit_SelectedCastlib me, chooseNewPath_optional, commitMsg")314 pLookUpCommandList.setaprop("SVN Commit selected castlib...", ["mSVN_Commit_SelectedCastlib me, chooseNewPath_optional, commitMsg", "svn_Utilities"]) 302 315 303 316 subli.add("SVN Commit current Movie...") 304 pLookUpCommandList.setaprop("SVN Commit current Movie...", "mSVN_Commit_CurrentMovie_Binaries me, chooseNewPath_optional, commitMsg")317 pLookUpCommandList.setaprop("SVN Commit current Movie...", ["mSVN_Commit_CurrentMovie_Binaries me, chooseNewPath_optional, commitMsg", "svn_Utilities"]) 305 318 306 319 ---------------------------------------------------- … … 312 325 313 326 subli.add("SVN Commit selected Castlib AND Scripttext...") 314 pLookUpCommandList.setaprop("SVN Commit selected Castlib AND Scripttext...", "mSVN_Commit_SelectedCastlib_AND_Scripttext me, chooseNewPath_optional, commitMsg, selectionList_optional")327 pLookUpCommandList.setaprop("SVN Commit selected Castlib AND Scripttext...", ["mSVN_Commit_SelectedCastlib_AND_Scripttext me, chooseNewPath_optional, commitMsg, selectionList_optional", "svn_Utilities"]) 315 328 316 329 subli.add("SVN Commit current Movie AND Scripttext...") 317 pLookUpCommandList.setaprop("SVN Commit current Movie AND Scripttext...", "mSVN_Commit_CurrentMovie_Binaries_AND_Scripttext me, chooseNewPath_optional, commitMsg")330 pLookUpCommandList.setaprop("SVN Commit current Movie AND Scripttext...", ["mSVN_Commit_CurrentMovie_Binaries_AND_Scripttext me, chooseNewPath_optional, commitMsg", "svn_Utilities"]) 318 331 319 332 ---------------------------------------------------- … … 327 340 328 341 subli.add("Convert textmember to HTML + copy to clipboard") 329 pLookUpCommandList.setaprop("Convert textmember to HTML + copy to clipboard", "mCopyConvert2HTML")342 pLookUpCommandList.setaprop("Convert textmember to HTML + copy to clipboard", ["mCopyConvert2HTML", "alexUtilities"]) 330 343 331 344 332 345 --------------------------------------------------- 333 346 subli.add("Fix colors in scriptlists (SES 10 -> SES 9)") 334 pLookUpCommandList.setaprop("Fix colors in scriptlists (SES 10 -> SES 9)", "Authoring_ExchangeScriptListColorsToRGBs me")347 pLookUpCommandList.setaprop("Fix colors in scriptlists (SES 10 -> SES 9)", ["Authoring_ExchangeScriptListColorsToRGBs me", "alexUtilities"]) 335 348 336 349 … … 343 356 344 357 subli.add("Make castlib label...") 345 pLookUpCommandList.setaprop("Make castlib label...", "makeLabel me, theContent, theBackgroundColor_optional, memberRef_optional")358 pLookUpCommandList.setaprop("Make castlib label...", ["makeLabel me, theContent, theBackgroundColor_optional, memberRef_optional", "alexUtilities"]) 346 359 347 360 … … 352 365 else fnd = "Explorer" 353 366 li.add("Open containing folder in" && fnd) 354 pLookUpCommandList.setaprop("Open containing folder in" && fnd, "mOpenContainingFolder me")367 pLookUpCommandList.setaprop("Open containing folder in" && fnd, ["mOpenContainingFolder me", "alexUtilities"]) 355 368 356 369 … … 406 419 407 420 -- some of the functions are "translated" and appear in a lookup list, in order to have nicer names 408 cmdli = string(pLookUpCommandList.getaprop(theName)) 409 if length(cmdli) < 1 then cmdli = theName 421 cmdli = pLookUpCommandList.getaprop(theName) 422 if not(listP(cmdli)) then 423 cmdli = [theName, "alexUtilities"] 424 else 425 if count(cmdli) < 1 then exit 426 if count(cmdli) < 2 then cmdli.add("alexUtilities") 427 theName = string(cmdli[1]) 428 end if 410 429 411 430 … … 421 440 else 422 441 423 cmd = cmdli.word[1] 424 delete word 1 of cmdli 442 cmdStr = cmdli[1] 443 targetScriptName = cmdli[2] 444 445 cmd = cmdStr.word[1] 446 delete word 1 of cmdStr 425 447 426 448 glob = xscr().mGetGlobalList() … … 428 450 olddelim = the itemdelimiter 429 451 the itemdelimiter = "," 430 delete item 1 of cmd li452 delete item 1 of cmdStr 431 453 the itemdelimiter = olddelim 432 454 … … 436 458 glob[#copy2ClipBoard] = 0 437 459 438 alexUtilities = new(script "alexUtilities")439 alexUtilities.setaprop(#pHandlerMenuWindowName, (the activewindow).name)440 glob[#theTargetInstance] = alexUtilities441 442 if cmd li.word.count then443 mShowMui cmd li460 targetScriptObject = new(script targetScriptName) 461 targetScriptObject.setaprop(#pHandlerMenuWindowName, (the activewindow).name) 462 glob[#theTargetInstance] = targetScriptObject 463 464 if cmdStr.word.count then 465 mShowMui cmdStr 444 466 else 445 467 mDoCmd -
trunk/lingosource/castlib1/alexUtilities.ls
r63 r74 159 159 if (voidP(pfad) or (pfad = "")) then 160 160 if mCheckForXtra(me, "BudAPI") = 1 then 161 162 resetUNames = 0 163 if baSysFolder("prefs") starts "/" then 164 baReturnUnixNames(0) 165 resetUNames = 1 166 end if 167 161 168 startfolder = string(startfolder) 162 169 if length(startfolder) > 0 then … … 165 172 pfad = baGetFilename("save", "", theDefaultName, "", 524288+4+2+4194304, theTitle, false, -1, -1) 166 173 end if 174 175 if resetUNames = 1 then baReturnUnixNames(1) 176 167 177 else 168 178 pfad = fio.displaySave(theTitle, theDefaultName) … … 315 325 theTitle = "Save text" 316 326 if mCheckForXtra(me, "BudAPI") = 1 then 327 328 resetUNames = 0 329 if baSysFolder("prefs") starts "/" then 330 baReturnUnixNames(0) 331 resetUNames = 1 332 end if 333 317 334 pfad = baGetFilename("save", "", theDefaultName, "", 524288+4+2+4194304, theTitle, false, -1, -1) 335 336 if resetUNames = 1 then baReturnUnixNames(1) 337 318 338 else 319 339 fio = new(xtra "fileio") … … 376 396 377 397 if mCheckForXtra(me, "BudAPI") = 1 then -- if buddy is present... 398 399 resetUNames = 0 400 if baSysFolder("prefs") starts "/" then 401 baReturnUnixNames(0) 402 resetUNames = 1 403 end if 404 378 405 retval = baGetFolder( "", "Select a folder", 3, "", 50, 50 ) 406 407 if resetUNames = 1 then baReturnUnixNames(1) 408 379 409 else if mCheckForXtra(me, "FileXtra4") = 1 then -- if not buddy then try filextra 380 410 fx = (xtra "filextra4").new() … … 409 439 410 440 if mCheckForXtra(me, "BudAPI") = 1 then -- if buddy is present... 441 442 -- currently there is a bug in buddy beta with bafilelist, so we hack here... 443 444 retval = [] 445 n = 1 446 this = getnthfilenameinfolder(folderpath, n) 447 repeat while length(this) > 0 448 if length(getnthfilenameinfolder(folderpath & this, 1)) = 0 then retval.add(this) 449 n = n + 1 450 this = getnthfilenameinfolder(folderpath, n) 451 end repeat 452 411 453 -- -- budApi version: 412 retval = baFileList(folderpath, "*.*")454 -- retval = baFileList(folderpath, "*.*") 413 455 414 456 else if mCheckForXtra(me, "FileXtra4") = 1 then -- if not buddy then try filextra … … 2153 2195 2154 2196 2155 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2156 on _______________BBEDIT_SCRIPTS end 2157 end 2158 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2159 2160 on mOpen_Linked_Script_With_BBedit me 2161 2162 if not(the platform contains "mac") then 2163 alert "Sorry, BBEdit is a mac application!" & RETURN & "If you change this handler to match something appropriate for Windows, please drop me a note. alex@farbflash.de" 2164 exit 2165 end if 2166 2167 if mCheckForXtra(me, "Shell") = 0 then 2168 mShellXtraMissing me 2169 exit 2170 end if 2171 2172 cl = the activecastlib 2173 sel = the selection of castlib cl 2174 2175 clistr = "bbedit" 2176 2177 repeat with sub in sel 2178 repeat with mem = sub[1] to sub[2] 2179 memref = member(mem,cl) 2180 if memref.type = #script then 2181 fname = memref.filename 2182 if fname.length then 2183 ppath = shell_cmd("osascript -e " & QUOTE & "return POSIX path of \" & QUOTE & fname & "\" & QUOTE & QUOTE) 2184 if charToNum(the last char of ppath) = 10 then delete the last char of ppath 2185 put " " & QUOTE & ppath & QUOTE after clistr 2186 end if 2187 end if 2188 end repeat 2189 end repeat 2190 2191 shell_cmd(clistr) 2192 end 2193 2194 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2195 2196 on mOpen_text_with_BBedit me 2197 2198 if not(the platform contains "mac") then 2199 alert "Sorry, BBEdit is a mac application!" & RETURN & "If you change this handler to match something appropriate for Windows, please drop me a note. alex@farbflash.de" 2200 exit 2201 end if 2202 2203 if mCheckForXtra(me, "Shell") = 0 then 2204 mShellXtraMissing me 2205 exit 2206 end if 2207 2208 cl = the activecastlib 2209 sel = the selection of castlib cl 2210 2211 2212 repeat with sub in sel 2213 repeat with mem = sub[1] to sub[2] 2214 2215 memref = member(mem,cl) 2216 2217 theText = "" 2218 theType = memref.type 2219 if theType = #script then 2220 theText = memref.scripttext 2221 else if theType = #text then 2222 theText = memref.html 2223 else if theType = #field then 2224 theText = memref.text 2225 end if 2226 2227 if length(theText) > 0 then 2228 2229 --------------------- 2230 -- create a temporary file from scripttext: 2231 -- tempSrcPath = shell_cmd_list("mktemp -t temp_BBEdit_file.ls") 2232 -- tempSrcPath = tempSrcPath[1] 2233 tempSrcPath = "/tmp/temp_BBEdit_file.ls" 2234 tempSrcHFSPath = shell_cmd_list("osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath & "\" & QUOTE & " as string" & QUOTE) 2235 tempSrcHFSPath = tempSrcHFSPath[1] 2236 theResult = mSaveTextToTempFile(me, theText, tempSrcHFSPath) 2237 --------------------- 2238 2239 shell_cmd("bbedit --wait --resume " & tempSrcPath) 2240 2241 theText = mGetTextFromFile(me, tempSrcHFSPath) 2242 2243 if theType = #script then 2244 memref.scripttext = theText 2245 else if theType = #text then 2246 memref.html = theText 2247 else if theType = #field then 2248 memref.text = theText 2249 end if 2250 2251 -- neuer = new(#field) 2252 -- neuer.text = theText 2253 -- 2254 -- oldclipboardNum = new(#field) 2255 -- oldclipboardNum.pasteClipBoardInto() 2256 -- 2257 -- copyToClipBoard(neuer) 2258 -- 2259 -- shell_cmd("pbpaste | bbedit") 2260 -- 2261 -- if oldclipboardNum.type <> #empty then copyToClipBoard(oldclipboardNum) 2262 -- oldclipboardNum.erase() 2263 -- neuer.erase() 2264 -- 2265 -- exit 2266 2267 end if 2268 end repeat 2269 end repeat 2270 2271 end 2272 2273 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2274 2275 on mCompareSelectedScriptmembersBatch me 2276 2277 if not(the platform contains "mac") then 2278 alert "Sorry, BBEdit is a mac application!" & RETURN & "If you change this handler to match something appropriate for Windows, please drop me a note. alex@farbflash.de" 2279 exit 2280 end if 2281 2282 if mCheckForXtra(me, "Shell") = 0 then 2283 mShellXtraMissing me 2284 exit 2285 end if 2286 2287 bbdiffpath = shell_cmd_list("which bbdiff") 2288 if count(bbdiffpath) > 0 then 2289 bbdiffpath = bbdiffpath[1] 2197 2198 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2199 on _______________SHELL_COMMAND me 2200 end 2201 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2202 2203 2204 on mDoShellCmd me, cmd, returnList 2205 2206 if mCheckForXtra(me, "ff_shell") = 0 then 2207 if mCheckForXtra(me, "Shell") = 0 then 2208 mShellXtraMissing me 2209 return "" 2210 else 2211 if returnList = 1 then 2212 return shell_cmd_list(cmd) 2213 else 2214 return shell_cmd(cmd) 2215 end if 2216 end if 2290 2217 else 2291 bbdiffpath = "" 2292 alert "Consider installing BBEdits command line tools. If we could use bbdiff it would be way nicer." 2293 end if 2294 2295 if length(bbdiffpath) > 0 then 2296 if mCheckForXtra(me, "FileIO") = 0 then 2297 alert "FileIO Xtra missing!" 2298 exit 2299 end if 2300 end if 2301 2302 textlist = [] 2303 2304 cl = the activecastlib 2305 sel = the selection of castlib cl 2306 2307 memberlist = [] 2308 repeat with sub in sel 2309 repeat with mem = sub[1] to sub[2] 2310 memberlist.add(member(mem,cl)) 2311 end repeat 2312 end repeat 2313 2314 cnt = count(memberlist) 2315 if (cnt mod 2) or (cnt = 0) then 2316 alert "Must be an even number of selected members" 2317 exit 2318 end if 2319 cnt = cnt/2 2320 2321 doit = 0 2322 2323 repeat with n = 1 to cnt 2324 2325 theText = "" 2326 2327 memref = memberlist[n] 2328 if memref.type = #script then 2329 theText = memref.scripttext 2330 else if [#text, #field].getPos(memref.type) > 0 then 2331 theText = memref.text 2332 end if 2333 2334 2335 2336 if length(theText) > 0 then 2337 2338 2339 fname = memref.name 2340 if length(fname) > 24 then 2341 fname = fname.char[1 .. 20] & "..." & fname.char[length(fname)] 2342 end if 2343 fname = fname & "___" & memref.membernum 2344 2345 2346 theText2 = "" 2347 2348 memref2 = memberlist[n+cnt] 2349 if memref2.type = #script then 2350 theText2 = memref2.scripttext 2351 else if [#text, #field].getPos(memref2.type) > 0 then 2352 theText2 = memref2.text 2353 end if 2354 2355 if length(theText2) > 0 then 2356 2357 name1 = memref.name 2358 if length(name1) < 1 then name1 = string(memref) 2359 name2 = memref2.name 2360 if length(name2) < 1 then name2 = string(memref2) 2361 2362 if theText = theText2 then 2363 2364 put "Members " & name1 & " and " & name2 & " are identical" 2365 2366 else 2367 2368 put "Members " & name1 & " and " & name2 & " differ" 2369 2370 if length(bbdiffpath) < 1 then 2371 2372 --------------------------------------------- the old version created new documents in bbedit and I selected "diff" for each from the menu 2373 --------------------------------------------- bbdiff is cooler ;-) 2374 oldclipboardNum = new(#field) 2375 oldclipboardNum.pasteClipBoardInto() 2376 2377 neuer = new(#field) 2378 2379 neuer.text = theText 2380 copyToClipBoard(neuer) 2381 shell_cmd("pbpaste | bbedit") 2382 2383 2384 neuer.text = theText2 2385 copyToClipBoard(neuer) 2386 shell_cmd("pbpaste | bbedit") 2387 2388 2389 2390 if oldclipboardNum.type <> #empty then copyToClipBoard(oldclipboardNum) 2391 oldclipboardNum.erase() 2392 neuer.erase() 2393 -------------------------------------------- 2394 2395 else 2396 2397 if doit = 0 then 2398 2399 tempSrcPath = shell_cmd_list("mktemp -d -t temp_BBDiff_folder1") 2400 tempSrcPath = tempSrcPath[1] & "/" 2401 tempSrcHFSPath = shell_cmd_list("osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath & "\" & QUOTE & " as string" & QUOTE) 2402 tempSrcHFSPath = tempSrcHFSPath[1] 2403 2404 2405 tempTgtPath = shell_cmd_list("mktemp -d -t temp_BBDiff_folder2") 2406 tempTgtPath = tempTgtPath[1] & "/" 2407 tempTgtHFSPath = shell_cmd_list("osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempTgtPath & "\" & QUOTE & " as string" & QUOTE) 2408 tempTgtHFSPath = tempTgtHFSPath[1] 2409 2410 2411 doit = 1 2412 end if 2413 2414 mSaveTextToTempFile(me, theText, tempSrcHFSPath & fname) 2415 mSaveTextToTempFile(me, theText2, tempTgtHFSPath & fname) 2416 2417 end if 2418 2419 end if 2420 2421 else 2422 put "skipping" && memref && "and" && memref2 && "because the length of the text of" && memref2 && "is 0" 2423 end if 2424 2218 ff_shellxtra = new(xtra "ff_shell") 2219 li = ff_shellxtra.ff_shell(cmd) 2220 ff_shellxtra = 0 2221 if returnList = 1 then 2222 retlist = [] 2223 if listP(li) then 2224 cnt = count(li) 2225 repeat with n = 1 to cnt 2226 this = li[n] 2227 if the last char of this = RETURN then delete the last char of this 2228 if charToNum(the last char of this) = 10 then delete the last char of this 2229 retlist.add(this) 2230 end repeat 2231 end if 2232 return retlist 2425 2233 else 2426 put "skipping" && memref && "because the length of the text is 0" 2427 end if 2428 2429 end repeat 2430 2431 -- put "mCompareSelectedScriptmembers 7" 2432 2433 if doit = 1 then 2434 -- put bbdiffpath && QUOTE & tempSrcPath & QUOTE && QUOTE & tempTgtPath & QUOTE 2435 shell_cmd(bbdiffpath && QUOTE & tempSrcPath & QUOTE && QUOTE & tempTgtPath & QUOTE) 2436 2437 else 2438 2439 -- put "doit = 0" 2440 2441 if length(bbdiffpath) > 0 then 2442 alert "No differences found" 2443 end if 2444 2445 end if 2446 2447 end 2448 2449 2450 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2451 2452 2453 on mBBDiff me, memref1, memref2 2454 2455 memref1 = member(memref1) 2456 2457 2458 if not(the platform contains "mac") then 2459 alert "Sorry, BBEdit is a mac application!" & RETURN & "If you change this handler to match something appropriate for Windows, please drop me a note. alex@farbflash.de" 2460 exit 2461 end if 2462 2463 if mCheckForXtra(me, "Shell") = 0 then 2464 mShellXtraMissing me 2465 exit 2466 end if 2467 2468 -- bbdiffpath = shell_cmd_list("which bbdiff") 2469 -- if count(bbdiffpath) > 0 then 2470 -- bbdiffpath = bbdiffpath[1] 2471 -- else 2472 -- bbdiffpath = "" 2473 -- alert "Consider installing BBEdits command line tools. If we could use bbdiff it would be way nicer." 2474 -- end if 2475 2476 2477 bbdiffpath = shell_cmd_list("which bbdiff") 2478 2479 if count(bbdiffpath) > 0 then 2480 bbdiffpath = bbdiffpath[1] 2481 else 2482 alert "This function only works with BBDiff, a command line tool provided by BBEdit. Consider installing BBEdits command line tools, it is really helpful." 2483 exit 2484 end if 2485 2486 --------------------- 2487 -- create a temporary file from scripttext: 2488 -- tempSrcPath = shell_cmd_list("mktemp -t temp_BBDiff_file1") 2489 -- tempSrcPath = tempSrcPath[1] 2490 tempSrcPath = "/tmp/temp_BBDiff_file1.ls" 2491 tempSrcHFSPath = shell_cmd_list("osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath & "\" & QUOTE & " as string" & QUOTE) 2492 tempSrcHFSPath = tempSrcHFSPath[1] 2493 2494 st1 = memref1.scripttext 2495 theResult = mSaveTextToTempFile(me, st1, tempSrcHFSPath) 2496 --------------------- 2497 2498 2499 2500 if not(voidP(memref2)) then memref2 = member(memref2) 2501 2502 ----------- there are 2 options for this handler: 2503 2504 if ilk(memref2) = #member then -- option 1: we have a second member and diff against the second member 2505 2506 st2 = memref2.scripttext 2507 if st1 = st2 then 2508 put "identical scripttext" 2509 exit 2510 end if 2511 2512 --------------------- 2513 -- create a temporary file from scripttext: 2514 -- tempSrcPath2 = shell_cmd_list("mktemp -t temp_BBDiff_file2") 2515 -- tempSrcPath2 = tempSrcPath2[1] 2516 tempSrcPath2 = "/tmp/temp_BBDiff_file2.ls" 2517 tempSrcHFSPath2 = shell_cmd_list("osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath2 & "\" & QUOTE & " as string" & QUOTE) 2518 tempSrcHFSPath2 = tempSrcHFSPath2[1] 2519 comm = tempSrcPath2 2520 2521 theResult = mSaveTextToTempFile(me, st2, tempSrcHFSPath2) 2522 --------------------- 2523 2524 else -- option 2: we have NO second member and diff against the file at the path in the member comments (=> alex linked scripts UNIX(!) path) 2525 comm = memref1.comments 2526 2527 end if 2528 2529 2530 2531 if comm.length then -- comm is our second file, we only diff, if there is either a second member OR a path in member.comments 2532 2533 if char 1 of comm = "~" then 2534 put shell_Cmd("echo -n $HOME") into char 1 of comm 2535 end if 2536 2537 shell_cmd(bbdiffpath & " --ignore-curly-quotes --ignore-spaces --wait --resume " "E& tempSrcPath "E&"E& comm "E) 2538 2539 -- since we used the --wait and the --resume switch, we will only come to this line AFTER the diff process in bbedit is finished 2540 2541 2542 -------- now write the results of the BBEdit diff back into the script members 2543 memref1.scripttext = mGetTextFromTempFile(me, tempSrcHFSPath) 2544 2545 if ilk(memref2) = #member then 2546 memref2.scripttext = mGetTextFromTempFile(me, tempSrcHFSPath2) 2547 end if 2548 2549 2550 else 2551 2552 alert "member has no comments!" 2553 2554 end if 2555 2556 end 2557 2558 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2559 2560 on mBBDiff_LiveCompare_SelectedScript me 2561 cl = the activecastlib 2562 sel = the selection of castlib cl 2563 if count(sel) > 0 then 2564 memref1 = member(sel[1][1], cl) 2565 if sel[1][2] <> sel[1][1] then 2566 memref2 = member(sel[1][2], cl) 2567 else 2568 if count(sel) < 2 then 2569 alert "Please select two castmembers!" 2570 exit 2571 end if 2572 memref2 = member(sel[2][1], cl) 2573 end if 2574 mBBDiff me, memref1, memref2 2575 end if 2576 end 2577 2578 2579 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2580 -- xxxxxxxxxxxxxxxxxx Write text out to a file 2581 --------------------- helper for the above bbdiff handler 2582 2583 on mSaveTextToTempFile me, theText, pfad 2584 2585 retval = 0 2586 2587 if ilk(theText) <> #string then return retval 2588 2589 fio = new(xtra "fileio") 2590 if not objectP(fio) then return retval 2591 2592 if ilk(pfad) = #string then 2593 if pfad.length > 0 then 2594 2595 fio.openFile(pfad, 0) 2596 if fio.status() = 0 then fio.delete() 2597 2598 fio.createFile(pfad) 2599 if fio.status() = 0 then 2600 2601 fio.openFile(pfad, 2) 2602 if fio.status() = 0 then 2603 2604 fio.writeString(theText) 2605 2606 if fio.status() = 0 then retval = pfad 2607 2608 fio.closeFile() 2609 end if 2610 end if 2611 end if 2612 end if 2613 2614 fio = 0 2615 2616 return retval 2617 end 2618 2619 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2620 -- xxxxxxxxxxxxxxxxxx Read text from file 2621 --------------------- helper for the above bbdiff handler 2622 2623 on mGetTextFromTempFile me, pfad 2624 retval = "" 2625 2626 if the runmode contains "Plugin" then return retval 2627 2628 fio = new(xtra "fileio") 2629 2630 if not objectP(fio) then return retval 2631 if (voidP(pfad) or (pfad = "")) then return retval 2632 2633 if ilk(pfad) = #string then 2634 if pfad.length > 0 then 2635 fio.openFile(pfad, 1) 2636 if fio.status() = 0 then 2637 retval = fio.readFile() 2638 fio.closeFile() 2639 end if 2640 end if 2641 end if 2642 fio = void 2643 2644 return retval 2645 2646 end 2647 2648 2649 2650 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2651 on _______________LINKED_SCRIPTS_HANDLERS me 2652 end 2653 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2654 2655 2656 -- LINKED SCRIPTS 2657 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2658 2659 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2660 -- refresh the linked member after the source of the linked script was changed 2661 2662 on mRefreshScripts me 2663 cl = the activecastlib 2664 sel = the selection of castlib cl 2665 anz = sel.count 2666 repeat with n = 1 to anz 2667 repeat with m = sel[n][1] to sel[n][2] 2668 memref = member(m, cl) 2669 if length(memref.filename) then memref.filename = memref.filename 2670 end repeat 2671 end repeat 2672 end 2673 2674 2675 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2676 -- unlink all linked scripts from all castlibs (when transferring a movie to another machine or before publishing) 2677 2678 on mUnLinkAllScripts me 2679 cnum = the number of castlibs 2680 repeat with l = 1 to cnum 2681 mnum = the number of members of castlib l 2682 repeat with n = 1 to mnum 2683 memref = member(n, l) 2684 if memref.type = #script then 2685 if (memref.linked = 1) then memref.linked = 0 2686 end if 2687 end repeat 2688 end repeat 2689 end 2690 2691 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2692 -- unlink the selected scriptmembers 2693 2694 on mUnLinkScripts me 2695 cl = the activecastlib 2696 sel = the selection of castlib cl 2697 anz = sel.count 2698 repeat with n = 1 to anz 2699 repeat with m = sel[n][1] to sel[n][2] 2700 memref = member(m, cl) 2701 if memref.type = #script then 2702 if (memref.linked = 1) then memref.linked = 0 2703 end if 2704 end repeat 2705 end repeat 2706 end 2707 2708 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2709 -- link the selected scriptmembers to the files specified in the first line of the members comments 2710 2711 on mLinkScripts me 2712 2713 cl = the activecastlib 2714 sel = the selection of castlib cl 2715 2716 mp = the moviepath 2717 if length(mp) < 1 then mp = the applicationpath 2718 delim = the last char of mp 2719 olddelim = the itemdelimiter 2720 the itemdelimiter = delim 2721 2722 isMac = (delim = ":") 2723 if isMac then CurrentOSXUserName = mGetCurrentOSXUserName(me) 2724 2725 repeat with sub in sel 2726 repeat with mem = sub[1] to sub[2] 2727 memref = member(mem,cl) 2728 if memref.type = #script then 2729 memname = memref.name 2730 comm = memref.comments 2731 if comm.length then 2732 2733 2734 if comm starts "~" then -- OSX current user directory 2735 if isMac then 2736 put "/Users/"&CurrentOSXUserName into char 1 of comm 2737 else 2738 offs = offset("/", comm) 2739 repeat while offs > 0 2740 put "\" into char offs of comm 2741 offs = offset("/", comm) 2742 end repeat 2743 put baSysFolder("personal") into char 1 to 2 of comm 2744 aPath = comm 2745 end if 2746 end if 2747 2748 if comm starts "/" then -- OSX/Unix style path 2749 2750 if isMac then 2751 hdname = getOsDirectory() 2752 hdname = hdname.item[1] 2753 the itemdelimiter = "/" 2754 delete item 1 of comm 2755 itemCnt = comm.item.count 2756 repeat with i = 1 to itemCnt 2757 put delim & comm.item[i] after hdname 2758 end repeat 2759 2760 aPath = hdname 2761 2762 else 2763 2764 if comm starts "/Users/alex/" then 2765 put baSysFolder("personal") into char 1 to 12 of comm 2766 end if 2767 aPath = comm 2768 2769 end if 2770 2771 2772 else if comm starts "@" then -- relative path with @ 2773 2774 if delim <> ":" then 2775 offs = offset(":", comm) 2776 repeat while offs > 0 2777 put delim into char offs of comm 2778 offs = offset(":", comm) 2779 end repeat 2780 end if 2781 2782 if delim <> "\" then 2783 offs = offset("\", comm) 2784 repeat while offs > 0 2785 put delim into char offs of comm 2786 offs = offset("\", comm) 2787 end repeat 2788 end if 2789 2790 offs = offset("/", comm) 2791 repeat while offs > 0 2792 put delim into char offs of comm 2793 offs = offset("/", comm) 2794 end repeat 2795 2796 delete char 1 of comm 2797 if char 1 of comm = delim then delete char 1 of comm 2798 2799 if char 1 of comm = delim then 2800 delete the last item of mp 2801 repeat while char 1 of comm = delim 2802 delete the last item of mp 2803 delete char 1 of comm 2804 end repeat 2805 put delim after mp 2806 aPath = mp & comm 2807 end if 2808 2809 else -- absolute path 2810 aPath = comm 2811 end if 2812 2813 fio = (xtra "fileio").new() 2814 if objectP(fio) then 2815 fio.openFile(aPath, 0) 2816 if fio.status() = 0 then 2817 fio.closeFile() 2818 2819 scomm = memref.comments 2820 stype = memref.scripttype 2821 sthumb = memref.thumbnail 2822 -- memref.linkAs(aPath) 2823 memref.filename = aPath 2824 2825 memref.thumbnail = sthumb 2826 memref.scripttype = stype 2827 memref.comments = scomm 2828 2829 end if 2830 end if 2831 fio = 0 2832 2833 2834 else 2835 2836 if memname.length then 2837 2838 hdname = getOsDirectory() 2839 anfp = hdname.item[1] & delim & "Users"& delim & CurrentOSXUserName & delim & "Documents"& delim 2840 aPath = anfp & "Scripts"& delim & "lingo"& delim & memname & ".ls" 2841 2842 fio = (xtra "fileio").new() 2843 if objectP(fio) then 2844 fio.openFile(aPath, 0) 2845 if fio.status() = 0 then 2846 fio.closeFile() 2847 2848 2849 stype = memref.scripttype 2850 sthumb = memref.thumbnail 2851 2852 memref.filename = aPath 2853 2854 memref.thumbnail = sthumb 2855 memref.scripttype = stype 2856 2857 -- memref.comments = "/Users/"&mGetCurrentOSXUserName()&"/Documents/Scripts/lingo/" & memname & ".ls" 2858 memref.comments = "~/Documents/Scripts/lingo/" & memname & ".ls" 2859 2860 else 2861 2862 aPath = anfp & "ALIEN"& delim & "myLinkedScripts"& delim & memname & ".ls" 2863 2864 fio.openFile(aPath, 0) 2865 if fio.status() = 0 then 2866 fio.closeFile() 2867 2868 2869 stype = memref.scripttype 2870 sthumb = memref.thumbnail 2871 2872 memref.filename = aPath 2873 2874 memref.thumbnail = sthumb 2875 memref.scripttype = stype 2876 -- memref.comments = "/Users/"&mGetCurrentOSXUserName()&"/Documents/ALIEN/myLinkedScripts/" & memname & ".ls" 2877 memref.comments = "~/Documents/ALIEN/myLinkedScripts/" & memname & ".ls" 2878 2879 else 2880 put "member: " & memname && "doesn't have a comment nor a linked script with the member name !" 2881 end if 2882 2883 2884 end if 2885 end if 2886 fio = 0 2887 2888 end if 2889 2890 end if 2891 end if 2892 end repeat 2893 end repeat 2894 2895 the itemdelimiter = olddelim 2896 2897 end 2898 2899 2900 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2901 2902 on mGetCurrentOSXUserName me 2903 2904 if mCheckForXtra(me, "FileXtra4") = 1 then 2905 xtraInstance = new(xtra "FileXtra4") 2906 theUser = xtraInstance.fx_FolderGetSpecialPath("kCurrentUserFolderType") 2907 xtraInstance = 0 2908 2909 olddelim = the itemdelimiter 2910 the itemdelimiter = the last char of the applicationpath 2911 delete the last item of theUser 2912 theUser = the last item of theUser 2913 the itemdelimiter = olddelim 2914 2915 else if mCheckForXtra(me, "Shell") = 1 then 2916 theUser = shell_cmd("whoami") 2917 if chartonum(the last char of theUser) = 10 then delete the last char of theUser 2918 2919 else 2920 theUser = "" 2921 2922 end if 2923 2924 return theUser 2925 2926 end 2927 2928 2929 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2930 -- compare selected scripts to the .ls script which is defined in their members comments 2931 -- if a difference is found some lines will get put into the message window to open the script in bbedit to do a file compare 2932 2933 on mCheckLSChange me 2934 2935 2936 -- if not(the platform contains "mac") then 2937 -- alert "Sorry, BBEdit is a mac application!" & RETURN & "If you change this handler to match something appropriate for Windows, please drop me a note. alex@farbflash.de" 2938 -- exit 2939 -- end if 2940 -- 2941 -- if mCheckForXtra(me, "Shell") = 0 then 2942 -- mShellXtraMissing me 2943 -- exit 2944 -- end if 2945 2946 2947 bbdiffpath = "" 2948 if the platform contains "mac" then 2949 2950 if mCheckForXtra(me, "Shell") = 1 then 2951 bbdiffpath = shell_cmd_list("which bbdiff") 2952 if count(bbdiffpath) > 0 then 2953 bbdiffpath = bbdiffpath[1] 2954 else 2955 bbdiffpath = "" 2956 alert "Consider installing BBEdits command line tools. If we could use bbdiff it would be way nicer." 2957 end if 2958 end if 2959 2960 if length(bbdiffpath) > 0 then 2961 if mCheckForXtra(me, "FileIO") = 0 then 2962 alert "FileIO Xtra missing!" 2963 exit 2964 end if 2965 end if 2966 2967 end if 2968 2969 2970 2971 2972 2973 cl = the activecastlib 2974 sel = the selection of castlib cl 2975 2976 mp = the moviepath 2977 if not mp.length then mp = the applicationpath 2978 delim = the last char of mp 2979 olddelim = the itemdelimiter 2980 the itemdelimiter = delim 2981 2982 isMac = (delim = ":") 2983 if isMac then CurrentOSXUserName = mGetCurrentOSXUserName(me) 2984 2985 repeat with sub in sel 2986 repeat with mem = sub[1] to sub[2] 2987 memref = member(mem,cl) 2988 if memref.type = #script then 2989 memname = memref.name 2990 comm = memref.comments 2991 if comm.length then 2992 2993 if comm starts "~" then -- OSX current user directory 2994 put "/Users/"&CurrentOSXUserName into char 1 of comm 2995 end if 2996 2997 if comm starts "/" then -- OSX/Unix style path 2998 2999 hdname = getOsDirectory() 3000 hdname = hdname.item[1] 3001 the itemdelimiter = "/" 3002 delete item 1 of comm 3003 itemCnt = comm.item.count 3004 repeat with i = 1 to itemCnt 3005 put delim & comm.item[i] after hdname 3006 end repeat 3007 3008 aPath = hdname 3009 3010 else if comm starts "@" then -- relative path with @ 3011 3012 if delim <> ":" then 3013 offs = offset(":", comm) 3014 repeat while offs > 0 3015 put delim into char offs of comm 3016 offs = offset(":", comm) 3017 end repeat 3018 end if 3019 3020 if delim <> "\" then 3021 offs = offset("\", comm) 3022 repeat while offs > 0 3023 put delim into char offs of comm 3024 offs = offset("\", comm) 3025 end repeat 3026 end if 3027 3028 offs = offset("/", comm) 3029 repeat while offs > 0 3030 put delim into char offs of comm 3031 offs = offset("/", comm) 3032 end repeat 3033 3034 delete char 1 of comm 3035 if char 1 of comm = delim then delete char 1 of comm 3036 3037 if char 1 of comm = delim then 3038 delete the last item of mp 3039 repeat while char 1 of comm = delim 3040 delete the last item of mp 3041 delete char 1 of comm 3042 end repeat 3043 put delim after mp 3044 aPath = mp & comm 3045 end if 3046 3047 else -- absolute path 3048 aPath = comm 3049 end if 3050 3051 fio = (xtra "fileio").new() 3052 if objectP(fio) then 3053 fio.openFile(aPath, 0) 3054 if fio.status() = 0 then 3055 vergText = fio.readFile() 3056 fio.closeFile() 3057 memscr = memref.scripttext 3058 if vergText <> memscr then 3059 3060 isEqual = 0 3061 if mCheckForXtra(me, "Pregex") = 1 then 3062 3063 memscrLi = [memscr] 3064 pregex_replace(memscrLi, "\s", "ig", "") 3065 memscrLi = memscrLi[1] 3066 3067 vergTextLi = [vergText] 3068 pregex_replace(vergTextLi, "\s", "ig", "") 3069 vergTextLi = vergTextLi[1] 3070 3071 isEqual = (memscrLi = vergTextLi) 3072 end if 3073 3074 if isEqual = 0 then 3075 3076 if length(bbdiffpath) < 1 then 3077 3078 3079 if not(the platform contains "mac") then 3080 put "-------------------------------------------------------" 3081 put RETURN&"neuer = new(#field)"&RETURN&"neuer.text = "&memref&".scripttext"&RETURN&"neuer.copyToClipBoard()"&RETURN&"neuer.erase()"&RETURN 3082 put RETURN&"shell_cmd(""E&"PBPaste | BBedit ; BBedit "&memref.comments"E&")"&RETURN 3083 else 3084 3085 if mCheckForXtra(me, "Shell") = 0 then 3086 put "-------------------------------------------------------" 3087 put RETURN&"neuer = new(#field)"&RETURN&"neuer.text = "&memref&".scripttext"&RETURN&"neuer.copyToClipBoard()"&RETURN&"neuer.erase()"&RETURN 3088 put RETURN&"shell_cmd(""E&"PBPaste | BBedit ; BBedit "&memref.comments"E&")"&RETURN 3089 3090 else 3091 3092 neuer = new(#field) 3093 neuer.text = memscr 3094 neuer.copyToClipBoard() 3095 neuer.erase() 3096 shell_cmd("PBPaste | BBedit ; BBedit "&memref.comments) 3097 3098 end if 3099 3100 end if 3101 3102 else 3103 3104 3105 tempSrcPath = shell_cmd_list("mktemp -t temp_BBDiff_file1") 3106 tempSrcPath = tempSrcPath[1] 3107 tempSrcHFSPath = shell_cmd_list("osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath & "\" & QUOTE & " as string" & QUOTE) 3108 tempSrcHFSPath = tempSrcHFSPath[1] 3109 3110 mSaveTextToTempFile(me, memref.scripttext, tempSrcHFSPath) 3111 3112 -- comm = memref.comments 3113 -- if comm.length then 3114 -- if char 1 of comm = "~" then 3115 -- put shell_Cmd("echo -n $HOME") into char 1 of comm 3116 -- end if 3117 -- end if 3118 3119 shell_cmd(bbdiffpath & " --ignore-curly-quotes --ignore-spaces --wait --resume " "E& tempSrcPath "E&"E& comm "E) 3120 3121 memref.scripttext = mGetTextFromFile(me, tempSrcHFSPath) 3122 3123 end if 3124 3125 end if 3126 3127 3128 end if 3129 3130 end if 3131 3132 end if 3133 end if 3134 fio = 0 3135 3136 end if 3137 3138 end repeat 3139 end repeat 3140 3141 the itemdelimiter = olddelim 3142 3143 3144 end 3145 3146 3147 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3148 3149 -- open the associated .ls, which is found in the member comments in bbedit 3150 on mBBedit me 3151 3152 if not(the platform contains "mac") then 3153 alert "Sorry, BBEdit is a mac application!" & RETURN & "If you change this handler to match something appropriate for Windows, please drop me a note. alex@farbflash.de" 3154 exit 3155 end if 3156 3157 if mCheckForXtra(me, "Shell") = 0 then 3158 mShellXtraMissing me 3159 exit 3160 end if 3161 3162 cl = the activecastlib 3163 sel = the selection of castlib cl 3164 3165 clistr = "bbedit" 3166 3167 home = shell_Cmd("echo -n $HOME") 3168 3169 repeat with sub in sel 3170 repeat with mem = sub[1] to sub[2] 3171 memref = member(mem,cl) 3172 if memref.type = #script then 3173 memname = memref.name 3174 comm = memref.comments 3175 if comm.length then 3176 if char 1 of comm = "~" then 3177 put home into char 1 of comm 3178 end if 3179 put " "&comm after clistr 3180 end if 3181 end if 3182 end repeat 3183 end repeat 3184 3185 shell_cmd(clistr) 3186 3187 end 3188 3189 3190 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3191 3192 on mExportListOfUsedLinkedScripts me 3193 3194 str = "" 3195 clnum = the number of castlibs 3196 repeat with cl = 1 to clnum 3197 anz = the number of members of castlib cl 3198 repeat with n = 1 to anz 3199 memref = member(n, cl) 3200 if memref.type = #script then 3201 comm = memref.comments 3202 if length(comm) > 0 then put "Membername:" && memref.name & TAB & "("&comm&")" & Return after str 3203 end if 3204 end repeat 3205 end repeat 3206 delete the last char of str 3207 3208 mn = the moviename 3209 offs = offset(".", mn) 3210 if offs > 0 then mn = mn.char[1 .. offs-1] 3211 3212 mSaveToTextFile me, str, "", "Save list of used linked scripts", mn & "_linkedScripts_List.txt" 3213 3214 end 3215 3216 3217 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3218 on _______________SVN_SCRIPT_TEXT me 3219 end 3220 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3221 3222 3223 on mCompareCurrentScriptToWorkingCopy me, convertLineBreaksToUnix 3224 3225 3226 if not(the platform contains "mac") then 3227 alert "This function only works with BBDiff, a command line tool provided by the OSX app BBEdit. I am sure, something similar exists for windows too, but you'll need to change this script yourself for windows" 3228 exit 3229 end if 3230 3231 if mCheckForXtra(me, "Shell") = 0 then 3232 mShellXtraMissing me 3233 exit 3234 end if 3235 3236 3237 bbdiffpath = mFindUnixAppInPath(me, "bbdiff") 3238 if length(bbdiffpath) < 1 then 3239 alert "This function only works with BBDiff, a command line tool provided by BBEdit. Consider installing BBEdits command line tools, it is really helpful." 3240 exit 3241 end if 3242 3243 3244 3245 cl = the activecastlib 3246 sel = the selection of castlib cl 3247 3248 repeat with sub in sel 3249 repeat with mem = sub[1] to sub[2] 3250 memref = member(mem,cl) 3251 3252 memtype = memref.type 3253 if [#script, #field, #text].getPos(memtype) > 0 then 3254 3255 case memtype of 3256 3257 ----------------------- 3258 #script: 3259 ext = ".ls" 3260 st = memref.scripttext 3261 3262 ----------------------- 3263 #field: 3264 ext = ".txt" 3265 st = memref.text 3266 3267 ----------------------- 3268 #text: 3269 ext = ".html" 3270 st = memref.html 3271 3272 ----------------------- 3273 otherwise: 3274 ext = ".txt" 3275 st = memref.text 3276 3277 end case 3278 3279 3280 thePath = mFindWorkingCopyCounterpart(me, memref, ext) 3281 3282 if length(thePath) < 1 then 3283 3284 put "Corresponding file for member " & memref.name && "(" & memref & ") was not found" 3285 3286 3287 else 3288 3289 3290 3291 --------------------- 3292 -- create a temporary file from scripttext: 3293 tempSrcPath = shell_cmd_list("mktemp -t temp_BBDiff_file1") 3294 tempSrcPath = tempSrcPath[1] 3295 3296 if mCheckForXtra(me, "budapi") = 0 then 3297 tempSrcHFSPath = shell_cmd_list("osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath & "\" & QUOTE & " as string" & QUOTE) 3298 tempSrcHFSPath = tempSrcHFSPath[1] 3299 else 3300 tempSrcHFSPath = baHFSName(tempSrcPath) 3301 end if 3302 3303 3304 3305 ------------------------------------------ trac subversion support works better with unix linebreaks... 3306 if voidP(convertLineBreaksToUnix) then convertLineBreaksToUnix = 1 3307 if convertLineBreaksToUnix = "" then convertLineBreaksToUnix = 1 3308 3309 if convertLineBreaksToUnix = 1 then 3310 3311 if mCheckForXtra(me, "Pregex") = 1 then 3312 3313 scrTextLi = [st] 3314 pregex_replace(scrTextLi, "\x0D\x0A?", "g", "\x0A") 3315 st = scrTextLi[1] 3316 3317 else 3318 3319 fndStr = numToChar(13) & numToChar(10) 3320 offs = offset(fndStr, st) 3321 repeat while offs > 0 3322 delete char offs of st 3323 offs = offset(fndStr, st) 3324 end repeat 3325 3326 fndStr = numToChar(13) 3327 offs = offset(fndStr, st) 3328 repeat while offs > 0 3329 put numToChar(10) into char offs of st 3330 offs = offset(fndStr, st) 3331 end repeat 3332 3333 end if 3334 end if 3335 ----------------------------------------- 3336 3337 3338 3339 theResult = mSaveTextToTempFile(me, st, tempSrcHFSPath) 3340 --------------------- 3341 3342 3343 3344 if mCheckForXtra(me, "budapi") = 0 then 3345 comm = thePath 3346 offs = offset(":", comm) 3347 repeat while offs 3348 put "/" into char offs of comm 3349 offs = offset(":", comm) 3350 end repeat 3351 put "/Volumes/" before comm 3352 else 3353 comm = baUnixName(thePath) 3354 end if 3355 3356 theResult = shell_cmd_list(bbdiffpath & " --ignore-curly-quotes --ignore-spaces --wait --resume " "E& tempSrcPath "E&"E& comm "E && "2>&1") 3357 3358 -- since we used the --wait and the --resume switch, we will only come to this line AFTER the diff process in bbedit is finished 3359 3360 if count(theResult) > 0 then 3361 put "No differences found for member: " & memref.name && "(" & memref & ")" 3362 3363 else 3364 3365 -------- now write the results of the BBEdit diff back into the script members 3366 scrText = mGetTextFromTempFile(me, tempSrcHFSPath) 3367 3368 3369 if convertLineBreaksToUnix = 1 then 3370 ------------------------------------------ trac subversion support works better with unix linebreaks... 3371 if mCheckForXtra(me, "Pregex") = 1 then 3372 3373 scrTextLi = [scrText] 3374 if the platform contains "mac" then 3375 pregex_replace(scrTextLi, "\x0D?\x0A", "g", "\x0D") 3376 else 3377 pregex_replace(scrTextLi, "\x0D([^\x0A])", "g", "\x0D\x0A\1") 3378 pregex_replace(scrTextLi, "([^\x0D])\x0A", "g", "\1\x0D\x0A") 3379 end if 3380 scrText = scrTextLi[1] 3381 3382 else 3383 3384 if the platform contains "mac" then 3385 3386 -- first convert windows to mac 3387 fndStr = numToChar(13) & numToChar(10) 3388 offs = offset(fndStr, scrText) 3389 repeat while offs > 0 3390 put numToChar(13) into char offs to offs+1 of scrText 3391 offs = offset(fndStr, scrText) 3392 end repeat 3393 3394 -- now convert unix to mac 3395 fndStr = numToChar(10) 3396 offs = offset(fndStr, scrText) 3397 repeat while offs > 0 3398 put numToChar(13) into char offs of scrText 3399 offs = offset(fndStr, scrText) 3400 end repeat 3401 3402 else 3403 3404 fndStr = numToChar(13) & numToChar(10) 3405 offs = offset(fndStr, scrText) 3406 repeat while offs > 0 3407 put "ÀÀÀ" into char offs+1 of scrText 3408 offs = offset(fndStr, scrText) 3409 end repeat 3410 3411 3412 fndStr = numToChar(10) 3413 offs = offset(fndStr, scrText) 3414 repeat while offs > 0 3415 put "ÀÀÀ" into char offs of scrText 3416 offs = offset(fndStr, scrText) 3417 end repeat 3418 3419 3420 3421 fndStr = numToChar(13) & "ÀÀÀ" 3422 offs = offset(fndStr, scrText) 3423 repeat while offs > 0 3424 put numToChar(13) & numToChar(10) into char offs to offs+3 of scrText 3425 offs = offset(fndStr, scrText) 3426 end repeat 3427 3428 3429 3430 fndStr = "ÀÀÀ" 3431 offs = offset(fndStr, scrText) 3432 repeat while offs > 0 3433 put numToChar(13) & numToChar(10) into char offs to offs+2 of scrText 3434 offs = offset(fndStr, scrText) 3435 end repeat 3436 3437 end if 3438 3439 end if 3440 ----------------------------------------- 3441 end if 3442 3443 3444 3445 case memtype of 3446 3447 ----------------------- 3448 #script: 3449 memref.scripttext = scrText 3450 3451 ----------------------- 3452 #field: 3453 memref.text = scrText 3454 3455 ----------------------- 3456 #text: 3457 memref.html = scrText 3458 3459 ----------------------- 3460 otherwise: 3461 memref.text = scrText 3462 3463 end case 3464 3465 3466 3467 3468 end if 3469 3470 -- exit -- we only proceed one script member, WHY ??? 3471 3472 3473 end if 3474 3475 end if -- corresponding file not found for this member 3476 3477 end repeat 3478 end repeat 3479 3480 3481 end 3482 3483 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3484 3485 on mFindUnixAppInPath me, whichBinaryName 3486 3487 binaryPath = [] 3488 3489 binaryPath = shell_cmd_list("for thisBinPath in /usr/bin /bin /usr/sbin /sbin /usr/local/sbin /usr/local/bin /opt/sbin /opt/bin /opt/local/sbin /opt/local/bin /sw/bin /sw/sbin ; do find $thisBinPath -name " & whichBinaryName & " ; done") 3490 3491 if count(binaryPath) > 0 then return binaryPath[1] 3492 2234 str = "" 2235 if listP(li) then 2236 cnt = count(li) 2237 repeat with n = 1 to cnt 2238 this = li[n] 2239 if the last char of this <> RETURN then put RETURN after this 2240 put this after str 2241 end repeat 2242 if length(str) > 0 then delete the last char of str 2243 end if 2244 return str 2245 end if 2246 end if 3493 2247 return "" 3494 2248 … … 3497 2251 3498 2252 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 3499 -- this can be used to open the corresponding script in bbedit and svn compare it to head3500 3501 on mExportCurrentScriptToWorkingCopyAndOpen me, convertLineBreaksToUnix3502 3503 mExportScriptsToFolder me, 1, 1, convertLineBreaksToUnix3504 3505 cl = the activecastlib3506 sel = the selection of castlib cl3507 3508 repeat with sub in sel3509 repeat with mem = sub[1] to sub[2]3510 memref = member(mem,cl)3511 memtype = memref.type3512 if [#script, #field, #text].getPos(memtype) > 0 then3513 3514 case memtype of3515 3516 -----------------------3517 #script:3518 ext = ".ls"3519 st = memref.scripttext3520 3521 -----------------------3522 #field:3523 ext = ".txt"3524 st = memref.text3525 3526 -----------------------3527 #text:3528 ext = ".html"3529 st = memref.html3530 3531 -----------------------3532 otherwise:3533 ext = ".txt"3534 st = memref.text3535 3536 end case3537 3538 3539 thePath = mFindWorkingCopyCounterpart(me, memref, ext)3540 3541 if length(thePath) < 1 then3542 alert "Corresponding member was not found"3543 exit3544 end if3545 3546 ------------------- export will now be done in "mExportScriptsToFolder"3547 -- st = memref.scripttext3548 -- mSaveToTextFile me, st, thePath3549 3550 if the platform contains "mac" then3551 if (mCheckForXtra(me, "budapi") + mCheckForXtra(me, "shell")) = 2 then3552 3553 bbeditBinary = mFindUnixAppInPath(me, "bbedit")3554 if length(bbeditBinary) > 0 then3555 shell_cmd(bbeditBinary && QUOTE & baUnixName(thePath) & QUOTE)3556 exit3557 end if3558 3559 end if3560 end if3561 3562 open thePath3563 exit3564 3565 end if3566 3567 end repeat3568 end repeat3569 3570 end3571 3572 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3573 3574 on mFindWorkingCopyCounterpart me, memref, file_extension3575 3576 file_extension = string(file_extension)3577 if length(file_extension) < 1 then file_extension = ".ls"3578 3579 workingCopies = value(getPref("svn_workingCopies_paths.txt"))3580 if ilk(workingCopies) <> #proplist then workingCopies = [:]3581 3582 theFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, 0, workingCopies, "No working copy is specified for this movies scripttext. Please select a working copy for the scripttext now.")3583 -- put "mFindWorkingCopyCounterpart: theFolder:" && theFolder3584 3585 if length(theFolder) < 1 then return ""3586 3587 3588 m = memref.castlibnum3589 3590 delim = the last char of the applicationpath3591 olddelim = the itemdelimiter3592 the itemdelimiter = delim3593 theFoldername = theFolder3594 if the last char of theFoldername = delim then delete the last char of theFoldername3595 else put delim after theFolder3596 theFoldername = the last item of theFoldername3597 the itemdelimiter = olddelim3598 3599 infolist = 03600 3601 if theFoldername <> "castlib" & m then3602 3603 newPath = theFolder & "castlib" & m & delim3604 3605 if baFolderExists(newPath) = 0 then3606 3607 infolistPath = theFolder & "memberInfo.xml"3608 3609 infolist = mReadXML_2_List(me, infolistPath)3610 3611 if ilk(infolist) <> #proplist then3612 3613 alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing."3614 return ""3615 3616 else3617 3618 if count(infolist) < 1 then3619 3620 alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing."3621 return ""3622 3623 else3624 theFolder = newPath3625 end if3626 3627 end if3628 3629 else3630 3631 theFolder = newPath3632 3633 end if3634 3635 end if3636 3637 3638 if infolist = 0 then3639 3640 infolistPath = theFolder & "memberInfo.xml"3641 infolist = mReadXML_2_List(me, infolistPath)3642 3643 if ilk(infolist) <> #proplist then3644 3645 alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing."3646 return ""3647 3648 end if3649 3650 end if3651 3652 3653 cnt = count(infolist)3654 3655 repeat with l = 1 to cnt3656 li = infolist[l]3657 -- put "memberName:" && li.getaprop(#memberName)3658 if li.getaprop(#memberName) = memref.name then3659 3660 fname = string(infolist[l].getaprop(#fname))3661 if length(fname) < 1 then fname = string(infolist.getpropat(l))3662 fpath = theFolder & fname & file_extension3663 3664 -- put "path:" && fpath3665 if length(baShortFilename(fpath)) > 0 then return fpath3666 3667 -- if baFileExists(fpath) then return fpath3668 3669 end if3670 end repeat3671 3672 3673 return ""3674 3675 end3676 3677 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3678 -- export all scripts into a folder (I use this to compare to versions of a movie, open movie 1, export all scripts, open movie 2 and export all scripts and then compare with bbdiff both folders)3679 3680 on mExportScriptsToFolder me, skipIcons, selectionOnly, convertLineBreaksToUnix, chooseNewPath3681 3682 mExportAllScriptsToDiskWithFolder me, skipIcons, selectionOnly, convertLineBreaksToUnix, void, chooseNewPath3683 3684 end3685 3686 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3687 3688 on mExportAllScriptsToDiskWithFolder me, skipIcons, selectionOnly, convertLineBreaksToUnix, theFolder, chooseNewPath3689 3690 theFolder = string(theFolder)3691 if length(theFolder) < 1 then3692 3693 if chooseNewPath <> 1 then3694 workingCopies = value(getPref("svn_workingCopies_paths.txt"))3695 if ilk(workingCopies) <> #proplist then workingCopies = [:]3696 3697 theFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies scripttext. Please select a working copy for the scripttext now.")3698 end if3699 3700 if length(theFolder) < 1 then3701 3702 theFolder = mGetFolderPathFromUser(me)3703 3704 end if3705 3706 end if3707 3708 if length(theFolder) < 1 then exit3709 3710 if ilk(selectionOnly) = #castlib then3711 firstCastNum = selectionOnly.number3712 lastCastNum = firstCastNum3713 selectionOnly = 03714 3715 else3716 if selectionOnly = 1 then3717 cl = the activecastlib3718 sel = the selection of castlib cl3719 3720 firstCastNum = cl3721 lastCastNum = cl3722 3723 else3724 firstCastNum = 13725 lastCastNum = the number of castlibs3726 end if3727 end if3728 3729 3730 DirectImageInstance = 03731 if skipIcons <> 1 then3732 if mCheckForXtra(me, "DirectImage") = 1 then3733 if the platform contains "mac" then3734 DirectImageInstance = new(xtra "DirectImage", 234521832)3735 else3736 DirectImageInstance = new(xtra "DirectImage", 228285877)3737 end if3738 else if mCheckForXtra(me, "SharpExport") = 1 then3739 SharpExportInst = new(xtra "SharpExport")3740 else3741 skipIcons = 13742 end if3743 end if3744 3745 3746 3747 3748 isMac = (the platform contains "mac") -- we need the differentiation because of the dreaded 31 char limit3749 3750 doit = 03751 3752 3753 statusSwitched = mSwitchToStatusMode(me, 1)3754 3755 repeat with m = firstCastNum to lastCastNum3756 3757 thisFolder = theFolder & "castlib" & m3758 if baFolderExists(thisFolder) <> 1 then3759 err = baCreateFolder(thisFolder)3760 if err <> 1 then3761 alert "Failed to create directory:" && thisFolder3762 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)3763 DirectImageInstance = 03764 exit3765 end if3766 end if3767 3768 thisFolder = thisFolder & the last char of the applicationpath3769 3770 3771 doit = 03772 infolistPath = thisFolder & "memberInfo.xml"3773 infolist = mReadXML_2_List(me, infolistPath)3774 if ilk(infolist) <> #proplist then infolist = [:]3775 3776 3777 if selectionOnly = 1 then3778 sel = the selection of castlib m3779 else3780 cnt = the number of members of castlib m3781 sel = [[1, cnt]]3782 end if3783 3784 repeat with sub in sel3785 repeat with n = sub[1] to sub[2]3786 3787 memref = member(n, m)3788 3789 memtype = memref.type3790 3791 -- if [#script].getPos(memtype) > 0 then3792 if [#script, #field, #text].getPos(memtype) > 0 then3793 3794 case memtype of3795 3796 -----------------------3797 #script:3798 ext = ".ls"3799 scrText = memref.scripttext3800 scrtype = memref.scripttype3801 -----------------------3802 #field:3803 ext = ".txt"3804 scrText = memref.text3805 scrtype = #field3806 -----------------------3807 #text:3808 ext = ".html"3809 scrText = memref.html3810 convertLineBreaksToUnix = 03811 scrtype = #text3812 -----------------------3813 otherwise:3814 ext = ".txt"3815 scrText = memref.text3816 scrtype = #field3817 end case3818 3819 3820 3821 memname = memref.name3822 3823 3824 mDisplayWaitStatusText me, "Processing member:" && memname3825 3826 3827 -- scrText = memref.scripttext3828 3829 3830 ------------- once I thought about adding the support for metadata directly to the script3831 ------------- metadata like thumbnail path, script type etc.3832 ------------- but currently I stick to the memberInfo.xml approach to store the metadata3833 ------------- so the following is disabled ... meanwhile...3834 ------------- the "memberInfo.xml" approach is more svn like anyway3835 3836 3837 -- ------------------------------ check for existing meta data3838 --3839 -- export_meta_data = scrText&""3840 -- offs = offset("-- -- -- export_meta_data", export_meta_data)3841 -- if offs > 0 then3842 -- delete char 1 to offs + 24 of export_meta_data3843 -- offs = offset("-- -- -- // export_meta_data", export_meta_data)3844 -- if offs > 0 then3845 -- delete char offs to length(export_meta_data) of export_meta_data3846 -- end if3847 -- numlines = export_meta_data.line.count3848 -- repeat with l = 1 to numlines3849 -- thisLine = export_meta_data.line[l]3850 --3851 -- end repeat3852 -- end if3853 --3854 -- ------------------------------3855 3856 3857 theDefaultName = memname3858 3859 doit = 13860 3861 if length(theDefaultName) < 1 then3862 theDefaultName = "member" & n & "_" & m3863 memref.name = theDefaultName3864 -- alert memref && "has no membername! Member without names will cause trouble when re-importing the scripts."3865 put "renamed member" && memref && "to member(" & QUOTE & theDefaultName & QUOTE & ") as member without names are not supported"3866 3867 else3868 3869 if memref <> member(theDefaultName, m) then3870 put "Member" && memref && "is duplicate. Member with duplicate names are not supported"3871 next repeat3872 end if3873 3874 end if3875 3876 3877 3878 -- if offset(".", theDefaultName) < 1 then put ".ls" after theDefaultName3879 3880 theDefaultName = mStripFunnyCharsFromFileName(me, theDefaultName)3881 3882 3883 origname = theDefaultName&""3884 if length(theDefaultName) > 25 and isMac then3885 3886 ms = string(the milliseconds)3887 mlen = length(ms)3888 ms = char mlen - 6 to mlen of ms3889 3890 theDefaultName = char 1 to 18 of theDefaultName3891 theDefaultName = theDefaultName & ms -- trim filenames as the mac version of fileio wants to deal with 31 chars3892 3893 end if3894 3895 3896 3897 ------------------------------------------ trac subversion support works better with unix linebreaks...3898 if voidP(convertLineBreaksToUnix) then convertLineBreaksToUnix = 13899 if convertLineBreaksToUnix = "" then convertLineBreaksToUnix = 13900 3901 if convertLineBreaksToUnix = 1 then3902 3903 if mCheckForXtra(me, "Pregex") = 1 then3904 3905 scrTextLi = [scrText]3906 pregex_replace(scrTextLi, "\x0D\x0A?", "g", "\x0A")3907 scrText = scrTextLi[1]3908 3909 else3910 3911 fndStr = numToChar(13) & numToChar(10)3912 offs = offset(fndStr, scrText)3913 repeat while offs > 03914 delete char offs of scrText3915 offs = offset(fndStr, scrText)3916 end repeat3917 3918 fndStr = numToChar(13)3919 offs = offset(fndStr, scrText)3920 repeat while offs > 03921 put numToChar(10) into char offs of scrText3922 offs = offset(fndStr, scrText)3923 end repeat3924 3925 end if3926 end if3927 -----------------------------------------3928 3929 3930 if theDefaultName <> origname then3931 alterText = ""3932 snam = baShortFileName(thisFolder & origname & ext)3933 if length(snam) > 0 then3934 alterText = mGetTextFromFile(me, thisFolder & origname & ext)3935 end if3936 else3937 alterText = mGetTextFromFile(me, thisFolder & theDefaultName & ext)3938 end if3939 3940 if alterText <> scrText then3941 3942 --------------------- compare without whitespaces:3943 noChanges = (mRemoveWhiteSpaces(me, scrText&"") = mRemoveWhiteSpaces(me, alterText&""))3944 3945 if noChanges = 0 then3946 3947 3948 mSaveToTextFile me, scrText, thisFolder & theDefaultName & ext3949 3950 3951 bmexp = 03952 if skipIcons <> 1 then3953 3954 thumbmember = new(#bitmap)3955 thumbmember.picture = memref.thumbnail3956 3957 if thumbmember.width > 0 then3958 bmexp = 13959 if baFileExists(thisFolder & theDefaultName & ".png") then baDeleteFile(thisFolder & theDefaultName & ".png")3960 3961 if objectP(DirectImageInstance) then3962 3963 DirectImageInstance.imageLoadFromMember(thumbmember)3964 DirectImageInstance.imageSaveToFile(thisFolder & theDefaultName & ".png", 100, 1,1)3965 3966 else if objectP(SharpExportInst) then3967 mExportBM me, thumbmember, thisFolder & theDefaultName & ".png", "png", 100, SharpExportInst3968 3969 end if3970 3971 end if3972 3973 thumbmember.erase()3974 3975 end if3976 3977 3978 if theDefaultName <> origname then3979 3980 snam = baShortFileName(thisFolder & origname & ext)3981 if length(snam) > 0 then baDeleteFile(snam)3982 erg = baRenameFile(thisFolder & theDefaultName & ext, thisFolder & origname & ext)3983 if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ext & " to " & thisFolder & origname & ext3984 if bmexp = 1 then3985 snam = baShortFileName(thisFolder & origname & ".png")3986 if length(snam) > 0 then baDeleteFile(snam)3987 erg = baRenameFile(thisFolder & theDefaultName & ".png", thisFolder & origname & ".png")3988 if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ".png to " & thisFolder & origname & ".png"3989 end if3990 3991 end if3992 3993 if origname <> memname then3994 put "Renamed member" && memref && "to" && origname & ". Scriptmember names must not be emoty or contain illegal characters (SPACE, /, :, \, &)"3995 end if3996 3997 end if3998 end if3999 4000 4001 infolist.setaprop(symbol(origname), [#scripttype: scrtype, #comments: memref.comments, #membername: memname, #fname: origname])4002 -- we need to store origname as string additionally to symbol, as the symbol may change the case (although only ufs is case sensitive4003 -- I am more comfortable with not relying on case insensitivity of filesystems)4004 4005 end if4006 4007 4008 end repeat4009 end repeat4010 4011 if doit = 1 then4012 -- mSaveList_2_XML me, infolist, infolistPath4013 4014 mRefreshMemberInfoList me, thisFolder, m, infolist4015 end if4016 4017 4018 end repeat4019 4020 DirectImageInstance = 04021 SharpExportInst = 04022 4023 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)4024 4025 end4026 4027 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4028 4029 on mRefreshMemberInfoList me, thisFolder, theCastlibNumber, infolist4030 4031 infolistPath = thisFolder & "memberInfo.xml"4032 4033 if ilk(infolist) <> #proplist then infolist = mReadXML_2_List(me, infolistPath)4034 if ilk(infolist) <> #proplist then infolist = [:]4035 newInfolist = [:]4036 4037 isMac = (the platform contains "mac")4038 4039 cnt = the number of members of castlib theCastlibNumber4040 4041 repeat with n = 1 to cnt4042 4043 memref = member(n, theCastlibNumber)4044 4045 memtype = memref.type4046 4047 -- if [#script].getPos(memtype) > 0 then4048 if [#script, #field, #text].getPos(memtype) > 0 then4049 4050 case memtype of4051 4052 -----------------------4053 #script:4054 ext = ".ls"4055 scrtype = memref.scripttype4056 -----------------------4057 #field:4058 ext = ".txt"4059 scrtype = #field4060 -----------------------4061 #text:4062 ext = ".html"4063 scrtype = #text4064 -----------------------4065 otherwise:4066 ext = ".txt"4067 scrtype = #field4068 4069 end case4070 4071 memname = memref.name4072 4073 theDefaultName = memname4074 4075 doit = 14076 4077 if length(theDefaultName) < 1 then4078 4079 put "Member" && memref && "has no name, therefore skipped"4080 4081 -- if length(theDefaultName) < 1 then4082 -- theDefaultName = "member" & n & "_" & theCastlibNumber4083 -- alert memref && "has no membername! Member without names will cause trouble when re-importing the scripts."4084 -- end if4085 4086 else4087 4088 if memref <> member(theDefaultName, theCastlibNumber) then4089 put "Member" && memref && "is duplicate. Member with duplicate names are not supported"4090 4091 else4092 theDefaultName = mStripFunnyCharsFromFileName(me, theDefaultName)4093 4094 4095 origname = theDefaultName&""4096 4097 oldlist = infolist.getaprop(symbol(origname))4098 if not(listP(oldlist)) then4099 oldlist = [:]4100 fname = origname4101 snam = baShortFileName(thisFolder & origname & ext)4102 if length(snam) < 1 then4103 put "Something seems wrong here. baShortFileName for " & thisFolder & origname & ext && "returned false. The file doesn't seem to exist!"4104 end if4105 oldlist.setaprop(#fname, origname)4106 end if4107 oldlist.setaprop(#scripttype, scrtype)4108 oldlist.setaprop(#comments, memref.comments)4109 oldlist.setaprop(#membername, memname)4110 4111 4112 newInfolist.setaprop(symbol(origname), oldlist)4113 -- we need to store origname as string additionally to symbol, as the symbol may change the case (although only ufs is case sensitive4114 -- I am more comfortable with not relying on case insensitivity of filesystems)4115 4116 end if4117 end if4118 end if4119 4120 end repeat4121 4122 if doit = 1 then mSaveList_2_XML me, newInfolist, infolistPath4123 4124 4125 end4126 4127 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4128 4129 on mStripFunnyCharsFromFileName me, theFileName4130 4131 offs = offset(" ", theFileName)4132 repeat while offs > 04133 put "_" into char offs of theFileName4134 offs = offset(" ", theFileName)4135 end repeat4136 4137 offs = offset("/", theFileName)4138 repeat while offs > 04139 put "_" into char offs of theFileName4140 offs = offset("/", theFileName)4141 end repeat4142 4143 offs = offset(":", theFileName)4144 repeat while offs > 04145 put "_" into char offs of theFileName4146 offs = offset(":", theFileName)4147 end repeat4148 4149 offs = offset("\", theFileName)4150 repeat while offs > 04151 put "_" into char offs of theFileName4152 offs = offset("\", theFileName)4153 end repeat4154 4155 offs = offset("&", theFileName)4156 repeat while offs > 04157 put "_" into char offs of theFileName4158 offs = offset("&", theFileName)4159 end repeat4160 4161 return theFileName4162 4163 end4164 4165 4166 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4167 4168 on mRemoveWhiteSpaces me, theText4169 4170 if mCheckForXtra(me, "Pregex") = 1 then4171 4172 theText = [theText]4173 PRegEx_Replace(theText, "\s" , "g", "")4174 return theText[1]4175 4176 else4177 whitespaces = [" ", RETURN]4178 repeat with ws = count(whitespaces) down to 14179 theText = mReplaceChunk(me, theText, whitespaces[ws], "")4180 end repeat4181 end if4182 4183 return theText4184 4185 end4186 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4187 4188 -- using offset() -> no pregex4189 on mReplaceChunk me, srcText, fromChunk, toChunk4190 4191 stelle = offset(fromChunk, srcText)4192 4193 if stelle then4194 4195 len = fromChunk.length4196 newtext = ""4197 replText = toChunk4198 4199 repeat while stelle4200 4201 if stelle > 1 then put char 1 to (stelle - 1) of srcText & replText after newtext4202 else put replText after newtext4203 4204 delete char 1 to (stelle + len - 1) of srcText4205 4206 stelle = offset(fromChunk, srcText)4207 4208 if stelle = 0 then put srcText after newtext4209 4210 end repeat4211 4212 else -- no match4213 4214 return srcText4215 end if4216 4217 return newtext4218 end4219 4220 4221 4222 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4223 4224 on mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath, selectionOnly4225 4226 if selectionOnly = 1 then4227 mUpdateSelectedScriptsFromFolder me, chooseNewPath4228 exit4229 end if4230 4231 4232 workingCopies = value(getPref("svn_workingCopies_paths.txt"))4233 if ilk(workingCopies) <> #proplist then workingCopies = [:]4234 4235 if chooseNewPath = 1 then4236 thePath = ""4237 else4238 thePath = string(mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies scripttext. Please select a working copy for the scripttext now."))4239 end if4240 4241 4242 if length(thePath) < 1 then thePath = mGetFolderPathFromUser(me)4243 4244 if length(thePath) < 1 then exit4245 4246 if mCheckForXtra(me, "budapi") then4247 4248 statusSwitched = mSwitchToStatusMode(me, 1)4249 4250 if baFileExists(thePath & "memberInfo.xml") then4251 mUpdateScriptCastlibFromFolder me, thePath4252 else4253 folderlist = bafolderlist(thePath)4254 delim = the last char of the applicationpath4255 cnt = count(folderlist)4256 repeat with n = 1 to cnt4257 if folderlist[n] starts "castlib" then4258 mUpdateScriptCastlibFromFolder me, thePath & folderlist[n] & delim4259 end if4260 end repeat4261 end if4262 4263 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)4264 4265 else4266 4267 alert "Hey, buddyAPI not found! Please install this must-have xtra. And try again."4268 4269 end if4270 4271 end4272 4273 4274 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4275 4276 on mUpdateScriptCastlibFromFolder me, thePath4277 4278 infoList = mReadXML_2_List(me, thePath & "memberInfo.xml")4279 4280 if ilk(infoList) <> #proplist then4281 alert thePath && "memberInfo.xml has no data! Can't update folder:" & thePath4282 return false4283 end if4284 4285 olddelim = the itemdelimiter4286 delim = the last char of the applicationpath4287 the itemdelimiter = delim4288 fd = thePath4289 if the last char of fd = delim then delete the last char of fd4290 fd = the last item of fd4291 the itemdelimiter = olddelim4292 4293 if not(fd starts "castlib") then4294 alert thePath && "does not seem to be valid, as its name doesn't start with " & QUOTE & "castlib" & QUOTE4295 return false4296 end if4297 4298 delete char 1 to 7 of fd4299 fd = integer(word 1 of fd)4300 4301 if not(integerP(fd)) then4302 alert thePath && "does not seem to be valid, as its name doesn't yield a castlib number:" && fd4303 return false4304 end if4305 4306 4307 if fd > the number of castlibs then4308 alert thePath && "points to a non-existant castlib (castlib" && fd & "). Please create the castlib before improting the scripts."4309 return false4310 end if4311 4312 cnt = count(infoList)4313 repeat with n = 1 to cnt4314 thisMemberInfo = infoList[n]4315 fname = string(thisMemberInfo.getaprop(#fname))4316 if length(fname) < 1 then fname = string(infoList.getPropAt(n))4317 fpath = thePath & fname4318 4319 scrtype = thisMemberInfo.getaprop(#scripttype)4320 case scrtype of4321 #field: ext = ".txt"4322 #text: ext = ".html"4323 otherwise: ext = ".ls"4324 end case4325 4326 mImportScriptWithThumbnail me, fpath & ext, fd, 1, thisMemberInfo4327 4328 end repeat4329 4330 4331 return true4332 end4333 4334 4335 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4336 4337 on mUpdateSelectedScriptsFromFolder me, chooseNewPath4338 4339 workingCopies = value(getPref("svn_workingCopies_paths.txt"))4340 if ilk(workingCopies) <> #proplist then workingCopies = [:]4341 4342 if chooseNewPath = 1 then4343 thePath = ""4344 else4345 thePath = string(mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies scripttext. Please select a working copy for the scripttext now."))4346 end if4347 4348 4349 if length(thePath) < 1 then thePath = mGetFolderPathFromUser(me)4350 4351 if length(thePath) < 1 then exit4352 4353 cl = the activecastlib4354 4355 olddelim = the itemdelimiter4356 the itemdelimiter = the last char of the applicationpath4357 fname = thePath4358 delete the last item of fname4359 fname = the last item of fname4360 the itemdelimiter = olddelim4361 4362 infolist = 04363 4364 if fname <> "castlib" & the number of castlib cl then4365 4366 newPath = thePath & "castlib" & the number of castlib cl & the last char of the applicationpath4367 4368 if baFolderExists(newPath) = 0 then4369 4370 infolistPath = thePath & "memberInfo.xml"4371 4372 infolist = mReadXML_2_List(me, infolistPath)4373 4374 if ilk(infolist) <> #proplist then4375 4376 alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing."4377 return 04378 4379 else4380 4381 thePath = newPath4382 4383 end if4384 4385 else4386 4387 thePath = newPath4388 4389 end if4390 4391 end if4392 4393 4394 if infolist = 0 then4395 4396 infolistPath = thePath & "memberInfo.xml"4397 infolist = mReadXML_2_List(me, infolistPath)4398 4399 if ilk(infolist) <> #proplist then4400 4401 alert "The specified folder (" & infolistPath & ") doesn't seem to contain info for this castlib: file memberInfo.xml missing."4402 return 04403 4404 end if4405 4406 end if4407 4408 4409 if count(infolist) < 1 then4410 4411 alert "The specified folder (" & infolistPath & ") doesn't seem to contain info for this castlib: file memberInfo.xml missing."4412 return 04413 4414 end if4415 4416 4417 cl = the activecastlib4418 sel = the selection of castlib cl4419 anz = sel.count4420 cnt = count(infolist)4421 4422 -- put "mUpdateSelectedScriptsFromFolder: infolist = " & infolist4423 4424 repeat with n = 1 to anz4425 repeat with m = sel[n][1] to sel[n][2]4426 memref = member(m, cl)4427 dertyp = memref.type4428 4429 if [#script, #text, #field].getPos(dertyp) > 0 then4430 4431 found = 04432 repeat with l = 1 to cnt4433 li = infolist[l]4434 if li.getaprop(#memberName) = memref.name then4435 4436 fname = string(infolist[l].getaprop(#fname))4437 if length(fname) < 1 then fname = string(infolist.getpropat(l))4438 4439 case dertyp of4440 #text: ext = ".html"4441 #field: ext = ".txt"4442 otherwise: ext = ".ls"4443 end case4444 4445 fpath = thePath & fname & ext4446 4447 found = 14448 4449 if baFileExists(fpath) then4450 mImportScriptWithThumbnail me, fpath, the number of castlib cl, 1, li4451 4452 put "mUpdateSelectedScriptsFromFolder: imported scripttext of" && memref && "from" && fpath4453 4454 else4455 put "mUpdateSelectedScriptsFromFolder: file doesn't exist ?? fpath = " & fpath4456 4457 end if4458 4459 end if4460 end repeat4461 4462 4463 if found = 0 then4464 put "Info for member" && memref && "was not found in memberinfo.xml"4465 end if4466 4467 end if4468 end repeat4469 end repeat4470 4471 4472 4473 return 14474 4475 end4476 4477 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4478 4479 on mImportScriptWithThumbnail me, thePath, castlibNumber, dontWarn, infolist4480 4481 -- <castlibNumber> is optional and will replace an existing script, if it exists4482 4483 castlibNumber = integer(castlibNumber)4484 if ilk(castlibNumber, #number) <> 1 then castlibNumber = 04485 if castlibNumber > the number of castlibs or castlibNumber = 0 then4486 cl = the activecastlib4487 castlibNumber = the number of castlib cl4488 end if4489 4490 4491 thePath = string(thePath)4492 if length(thePath) < 1 then thePath = mGetFilePathFromUser(me)4493 4494 if length(thePath) < 1 then exit4495 4496 if mCheckForXtra(me, "budapi") then4497 buddyApiPresent = 14498 spath = bashortfilename(thePath)4499 if length(spath) < 1 then4500 alert "file does not exist:" && spath4501 exit4502 end if4503 else4504 buddyApiPresent = 04505 spath = thePath4506 end if4507 4508 4509 mDisplayWaitStatusText me, "Importing file:" && spath4510 4511 4512 scrtext = mGetTextFromFile(me, spath)4513 4514 if length(scrtext) < 1 then4515 alert "file not found:" && spath4516 return 04517 end if4518 4519 oldd = the itemdelimiter4520 the itemdelimiter = the last char of the applicationpath4521 fname = the last item of thePath4522 delete the last item of thePath4523 put the itemdelimiter after thePath4524 4525 extension = ""4526 repeat while length(fname)4527 put the last char of fname before extension4528 delete the last char of fname4529 if char 1 of extension = "." then exit repeat4530 end repeat4531 if char 1 of extension <> "." then4532 put extension after fname4533 extension = ""4534 end if4535 4536 if ilk(infolist) <> #proplist then4537 infolistPath = thePath & "memberInfo.xml"4538 infolist = mReadXML_2_List(me, infolistPath)4539 if ilk(infolist) <> #proplist then infolist = [:]4540 4541 infolist = infolist.getaprop(symbol(fname))4542 if ilk(infolist) <> #proplist then infolist = [:]4543 end if4544 4545 scrtype = infolist.getaprop(#scripttype)4546 if ilk(scrtype) <> #symbol then4547 ident = "-- scripttype = "4548 scrtype = offset(ident, scrtext)4549 if scrtype > 0 then4550 scrtype = scrtext.word[scrtext.char[1 .. scrtype+length(ident) - 1].word.count + 1]4551 scrtype = value(scrtype)4552 if ilk(scrtype) <> #symbol then scrtype = 04553 end if4554 end if4555 4556 4557 cmts = infolist.getaprop(#comments)4558 if voidP(cmts) then4559 ident = "-- comments = "4560 cmts = offset(ident, scrtext)4561 if cmts > 0 then4562 cmts = scrtext.line[scrtext.char[1 .. cmts+length(ident) - 1].line.count]4563 delete char 1 to length(ident) - 1 of cmts4564 end if4565 end if4566 4567 4568 theIcon = thePath & fname & ".png"4569 4570 -- if length(fname & ".png") > 31 and (the platform contains "mac") then4571 --4572 -- unixname = baUnixName(theIcon)4573 -- if length(unixname) > 0 then4574 -- tempSrcPath = shell_cmd_list("mktemp -t temp_icon_file.XXXX")4575 -- tempSrcPath = tempSrcPath[1] & ".png"4576 -- shell_cmd_list("cp " & QUOTE & unixname & QUOTE && QUOTE& tempSrcPath "E)4577 -- theIcon = baHFSName(tempSrcPath)4578 -- else4579 -- theIcon = ""4580 -- end if4581 --4582 -- end if4583 4584 if buddyApiPresent = 1 then theIcon = bashortfilename(theIcon)4585 4586 4587 fio = new(xtra "fileio")4588 if length(theIcon) > 0 then4589 fio.openFile(theIcon, 1)4590 if fio.status() = 0 then4591 i = new(#bitmap)4592 i.importFileInto(theIcon)4593 theIcon = i.picture4594 fio.closeFile()4595 end if4596 end if4597 4598 4599 membername = infolist.getaprop(#membername)4600 if voidP(membername) then4601 scrname = fname4602 else4603 scrname = string(membername)4604 end if4605 4606 4607 case scrtype of4608 #field, #text: memtype = scrtype4609 otherwise: memtype = #script4610 end case4611 4612 4613 askreplace = 14614 scr = member(scrname, castlibNumber)4615 if voidP(scr) then4616 scr = new(memtype, castlib(castlibNumber))4617 askreplace = 04618 end if4619 if scr.type <> #script then4620 scr = new(memtype, castlib(castlibNumber))4621 askreplace = 04622 end if4623 4624 if dontWarn = 1 then askreplace = 04625 4626 if askreplace = 1 then4627 if buddyApiPresent = 1 then4628 if baMsgBox("Replace member" && scrname, "Replace", "Yesno", "Warning", 1) = "No" then4629 if ilk(i) = #member then i.erase()4630 fio = 04631 return 04632 end if4633 end if4634 end if4635 4636 scr.name = scrname4637 4638 4639 4640 ------------------------------------------ trac subversion support works better with unix linebreaks...4641 if mCheckForXtra(me, "Pregex") = 1 then4642 4643 scrTextLi = [scrText]4644 if the platform contains "mac" then4645 pregex_replace(scrTextLi, "\x0D?\x0A", "g", "\x0D")4646 else4647 pregex_replace(scrTextLi, "\x0D([^\x0A])", "g", "\x0D\x0A\1")4648 pregex_replace(scrTextLi, "([^\x0D])\x0A", "g", "\1\x0D\x0A")4649 end if4650 scrText = scrTextLi[1]4651 4652 else4653 4654 if the platform contains "mac" then4655 4656 -- first convert windows to mac4657 fndStr = numToChar(13) & numToChar(10)4658 offs = offset(fndStr, scrText)4659 repeat while offs > 04660 put numToChar(13) into char offs to offs+1 of scrText4661 offs = offset(fndStr, scrText)4662 end repeat4663 4664 -- now convert unix to mac4665 fndStr = numToChar(10)4666 offs = offset(fndStr, scrText)4667 repeat while offs > 04668 put numToChar(13) into char offs of scrText4669 offs = offset(fndStr, scrText)4670 end repeat4671 4672 else4673 4674 4675 -- fndStr = numToChar(13) & numToChar(10)4676 -- offs = offset(fndStr, scrText)4677 -- repeat while offs > 04678 -- delete char offs of scrText4679 -- offs = offset(fndStr, scrText)4680 -- end repeat4681 4682 fndStr = numToChar(13) & numToChar(10)4683 offs = offset(fndStr, scrText)4684 repeat while offs > 04685 put numToChar(13) into char offs+1 of scrText4686 offs = offset(fndStr, scrText)4687 end repeat4688 4689 4690 fndStr = numToChar(10)4691 offs = offset(fndStr, scrText)4692 repeat while offs > 04693 put numToChar(13) into char offs of scrText4694 offs = offset(fndStr, scrText)4695 end repeat4696 4697 end if4698 4699 end if4700 -----------------------------------------4701 4702 4703 4704 case scrtype of4705 #field: scr.text = scrtext4706 #text: scr.html = scrtext4707 otherwise: scr.scripttext = scrtext4708 end case4709 4710 4711 if [#movie, #parent, #score].getPos(scrtype) > 0 then scr.scripttype = scrtype4712 if cmts <> 0 then scr.comments = cmts4713 if ilk(theIcon) = #picture then scr.thumbnail = theIcon4714 4715 if ilk(i) = #member then i.erase()4716 fio = 04717 4718 4719 mDisplayWaitStatusText me, "Imported file:" && spath && "into member" && scr4720 4721 4722 return 14723 4724 end4725 4726 4727 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4728 on _______________SVN_FIELD_TEXT me4729 end4730 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4731 4732 on mExportTextAndFieldsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional4733 mExportScriptsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional4734 end4735 4736 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4737 4738 on mImportTextAndFields me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional4739 mImportScriptWithThumbnail me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional4740 end4741 4742 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4743 on _______________SVN_SUPPORT me4744 end4745 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4746 4747 on mSVN_Update_Working_Copy_ScriptText me, chooseNewPath4748 4749 workingCopies = value(getPref("svn_workingCopies_paths.txt"))4750 if ilk(workingCopies) <> #proplist then workingCopies = [:]4751 4752 svnBinary = mGetSVNBinaryPath(me, workingCopies)4753 if length(svnBinary) < 1 then exit4754 4755 workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies scripttext. Please select a working copy for the scripttext now.")4756 if length(workingFolder) < 1 then exit4757 4758 if the platform contains "mac" then4759 svnBinary = baUnixName(svnBinary)4760 workingFolder = baUnixName(workingFolder)4761 else4762 if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder4763 end if4764 4765 statusSwitched = mSwitchToStatusMode(me, 1)4766 mDisplayWaitStatusText me, "Updating folder:" && workingFolder4767 4768 theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE)4769 4770 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)4771 4772 if count(theresult) > 0 then4773 put theresult[1]4774 alert "Done, see the results of the svn operation in the message window."4775 else4776 alert "svn application did not respond, something seems to have failed. :-("4777 end if4778 4779 setPref("svn_workingCopies_paths.txt", string(workingCopies))4780 4781 end4782 4783 4784 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx4785 4786 on mSVN_Delete_Selected_Scripts me, chooseNewPath4787 4788 4789 workingCopies = value(getPref("svn_workingCopies_paths.txt"))4790 if ilk(workingCopies) <> #proplist then workingCopies = [:]4791 4792 svnBinary = mGetSVNBinaryPath(me, workingCopies)4793 if length(svnBinary) < 1 then exit4794 4795 workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies scripttext. Please select a working copy for the scripttext now.")4796 if length(workingFolder) < 1 then exit4797 4798 4799 if the platform contains "mac" then4800 isMac = 14801 svnBinary = baUnixName(svnBinary)4802 4803 else4804 isMac = 04805 4806 end if4807 4808 4809 thePath = workingFolder4810 4811 cl = the activecastlib4812 4813 pathdelim = the last char of the applicationpath4814 olddelim = the itemdelimiter4815 the itemdelimiter = pathdelim4816 fname = thePath4817 delete the last item of fname4818 fname = the last item of fname4819 the itemdelimiter = olddelim4820 4821 infolist = 04822 4823 if fname <> "castlib" & the number of castlib cl then4824 4825 newPath = thePath & "castlib" & the number of castlib cl4826 4827 if baFolderExists(newPath) = 0 then4828 4829 infolistPath = thePath & pathdelim & "memberInfo.xml"4830 4831 infolist = mReadXML_2_List(me, infolistPath)4832 4833 if ilk(infolist) <> #proplist then4834 4835 alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing."4836 return 04837 4838 else4839 4840 thePath = newPath & pathdelim4841 4842 end if4843 4844 else4845 4846 thePath = newPath & pathdelim4847 4848 end if4849 end if4850 4851 4852 if infolist = 0 then4853 4854 infolistPath = thePath & "memberInfo.xml"4855 infolist = mReadXML_2_List(me, infolistPath)4856 4857 if ilk(infolist) <> #proplist then4858 4859 alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing."4860 return 04861 4862 end if4863 4864 end if4865 4866 if ilk(infolist) <> #proplist then4867 4868 alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing."4869 return 04870 4871 end if4872 4873 if count(infolist) < 1 then4874 4875 alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing."4876 return 04877 4878 end if4879 4880 doCommit = 04881 saveRequired = 04882 4883 cl = the activecastlib4884 sel = the selection of castlib cl4885 anz = sel.count4886 cnt = count(infolist)4887 repeat with n = 1 to anz4888 repeat with m = sel[n][1] to sel[n][2]4889 memref = member(m, cl)4890 dertyp = memref.type4891 4892 put "processing member" && memref4893 4894 if [#script, #field, #text].getPos(dertyp) then4895 4896 putstr = ""4897 repeat with l = 1 to cnt4898 li = infolist[l]4899 4900 -- put "listref =" && li4901 4902 if li.getaprop(#memberName) = memref.name then4903 4904 theFilename = string(li.getaprop(#fname))4905 if length(theFilename) < 1 then theFilename = string(infolist.getpropat(l))4906 4907 scrtype = li.getaprop(#scripttype)4908 case scrtype of4909 #field: ext = ".txt"4910 #text: ext = ".html"4911 otherwise: ext = ".ls"4912 end case4913 4914 fpath = thePath & theFilename & ext4915 4916 put "checking for file" && fpath4917 4918 if isMac = 1 then4919 sname = baShortFileName(fpath)4920 else4921 sname = fpath4922 end if4923 4924 if baFileExists(fpath) then4925 4926 if isMac = 1 then4927 ufpath = baUnixName(fpath)4928 else4929 ufpath = fpath4930 end if4931 4932 theresult = shell_cmd_list(svnBinary && "delete" && QUOTE & ufpath & QUOTE)4933 if count(theresult) < 1 then4934 put "failed to svn delete member " & memref & " no result from svn?!"4935 else4936 put theresult[1]4937 doCommit = 14938 end if4939 4940 infolist.deleteAt(l)4941 memref.erase()4942 saveRequired = 14943 put "Erase member:" && memref.name4944 4945 putstr = ""4946 4947 exit repeat4948 4949 else4950 4951 putstr = "No corresponding file o disk was found for member" && memref.name && "(" & memref & ") erase the member manually:" & RETURN & memref & ".erase()" & RETURN4952 4953 end if4954 4955 end if4956 4957 end repeat4958 4959 if length(putstr) then put putstr4960 4961 end if4962 end repeat4963 end repeat4964 4965 4966 if saveRequired = 1 then4967 4968 if (baMsgBoxEx("The movie has been changed. Save changes to this movie?", "Save changes?", "Save", "Don't save", "", "Question", 1, "left", "Arial", 14, 4, -2, -2) = "Save") then4969 saveMovie()4970 end if4971 4972 mRefreshMemberInfoList me, thePath, castlib(cl).number4973 4974 end if4975 4976 4977 if doCommit = 1 then4978 4979 msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2)4980 4981 if length(msg) < 1 then4982 alert "You must enter a message for the commit action."4983 exit4984 end if4985 4986 if isMac = 1 then4987 workingFolder = baUnixName(workingFolder)4988 else4989 if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder4990 end if4991 4992 theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE && QUOTE & workingFolder & QUOTE)4993 4994 if count(theresult) > 0 then4995 put theresult[1]4996 alert "Done, see the results of the svn operation in the message window."4997 else4998 alert "svn application did not respond, something seems to have failed. :-("4999 end if5000 5001 else5002 5003 alert "Nothing has been committed!"5004 5005 end if5006 5007 return 15008 5009 end5010 5011 5012 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5013 5014 on mSVN_Commit_CurrentMovie_Binaries_AND_Scripttext me, chooseNewPath, commitMsg5015 5016 commitMsg = string(commitMsg)5017 if length(commitMsg) < 1 then5018 commitMsg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2)5019 5020 if length(commitMsg) < 1 then5021 alert "You must enter a message for the commit action."5022 exit5023 end if5024 end if5025 5026 5027 theResult = mSVN_Commit_CurrentScripts_ScriptText(me, 0, chooseNewPath, commitMsg, 1)5028 5029 theResult = mSVN_Commit_CurrentMovie_Binaries(me, chooseNewPath, commitMsg, 1)5030 5031 5032 end5033 5034 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5035 5036 on mSVN_Commit_SelectedCastlib_AND_Scripttext me, chooseNewPath, commitMsg, selectionList5037 5038 commitMsg = string(commitMsg)5039 if length(commitMsg) < 1 then5040 commitMsg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2)5041 5042 if length(commitMsg) < 1 then5043 alert "You must enter a message for the commit action."5044 exit5045 end if5046 end if5047 5048 5049 theResult = mSVN_Commit_CurrentScripts_ScriptText(me, castlib(the activecastlib), chooseNewPath, commitMsg, 1, selectionList)5050 5051 theResult = mSVN_Commit_SelectedCastlib(me, chooseNewPath, commitMsg, 1, 0, selectionList)5052 5053 5054 end5055 5056 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5057 5058 on mSVN_Commit_SelectedCastlib me, chooseNewPath, commitMsg, dontSave, dontShowAlert, selectionList5059 5060 5061 castlibList = 05062 selectionList = string(selectionList)5063 if length(selectionList) > 0 then5064 if char 1 of selectionList <> "[" then put "[" before selectionList5065 if the last char of selectionList <> "]" then put "]" after selectionList5066 selectionList = value(selectionList)5067 if listP(selectionList) then5068 clnum = the number of castlibs + 15069 castlibList = []5070 selectionListCnt = count(selectionList)5071 repeat with n = 1 to selectionListCnt5072 int = integer(selectionList[n])5073 if integerP(int) then5074 if clnum > int then5075 if castlibList.getPos(int) < 1 then castlibList.add(int)5076 end if5077 end if5078 end repeat5079 end if5080 end if5081 5082 if castlibList = 0 then5083 castlibList = []5084 actCL = the activecastlib5085 castlibList.add(actCL)5086 end if5087 5088 5089 mpname = the moviepath & the moviename5090 isInternal = 05091 repeat with cl in castlibList5092 if castlib(cl).filename = mpname then5093 isInternal = 15094 exit repeat5095 end if5096 end repeat5097 5098 5099 if count(castlibList) < 1 then5100 alert "No castlib selected. The parameter didn't yiled a valid list. Make sure, that you provide a linear list with integers, specifying a number of a castlib each."5101 return 05102 end if5103 5104 5105 5106 put "Committing castlibs:" && castlibList5107 5108 5109 workingCopies = value(getPref("svn_wCopies_paths_Binary.txt"))5110 if ilk(workingCopies) <> #proplist then workingCopies = [:]5111 5112 svnBinary = mGetSVNBinaryPath(me, workingCopies)5113 if length(svnBinary) < 1 then return 05114 5115 workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies binaries (director files). Please select a working copy of the director files.")5116 if length(workingFolder) < 1 then return 05117 5118 5119 ---------------------------------------5120 msg = string(commitMsg)5121 if length(msg) < 1 then5122 msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2)5123 5124 if length(msg) < 1 then5125 alert "You must enter a message for the commit action."5126 return 05127 end if5128 end if5129 ---------------------------------------5130 5131 5132 ---------------------------------------5133 if dontSave <> 1 then5134 -- this flag is only for the case, we come here from the combined commit call "mSVN_Commit_CurrentMovie_Binaries_AND_Scripttext"5135 -- as the movie was already saved in "mSVN_Commit_CurrentScripts_ScriptText"5136 5137 if workingCopies.getaprop(#dontWarnWhenSaving) <> 1 then5138 answer = baMsgBoxEx("The castlib will be saved before committing.", "Save castlib?", "Save", "Cancel", "Always save", "Question", 1, "left", "Arial", 14, 4, -2, -2)5139 if answer = "Cancel" then return 05140 if answer = "Always save" then workingCopies.setaprop(#dontWarnWhenSaving, 1)5141 end if5142 5143 -- if the moviepath & the moviename = castlib(actCL).filename then5144 -- savemovie()5145 -- else5146 -- castlib(actCL).save()5147 -- end if5148 5149 if isInternal = 1 then5150 savemovie()5151 else5152 repeat with cl in castlibList5153 castlib(cl).save()5154 end repeat5155 end if5156 5157 end if5158 ----------------------------------------5159 5160 5161 statusSwitched = mSwitchToStatusMode(me, 1)5162 mDisplayWaitStatusText me, "Committing castlibs:" && castlibList5163 5164 5165 5166 -- fname = castlib(actCL).filename5167 5168 5169 ---------------------------------------5170 if workingFolder <> the moviepath then5171 5172 mp = the moviepath5173 mplen = length(mp)5174 olddelim = the itemdelimiter5175 the itemdelimiter = mp5176 5177 5178 castlibListCnt = count(castlibList)5179 repeat with r = 1 to castlibListCnt5180 cl = castlibList[r]5181 5182 fname = castlib(cl).filename5183 5184 if length(fname) > 0 then5185 5186 offs = offset(mp, fname)5187 if offs <> 1 then5188 alert "Castlib" && castlib(actCL) && "is not within your current moviepath. This is not supported."5189 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5190 return 05191 end if5192 5193 relpath = fname5194 delete char 1 to mplen of relpath5195 5196 newpath = workingFolder & relpath5197 newpathDir = newpath5198 delete the last item of newpathDir5199 if baFolderExists(newpathDir) <> 1 then baCreateFolder(newpathDir)5200 baCopyFileProgress(fname, newpath, "Always", "Copying castlib " & actCL & " to working folder", "", 33)5201 5202 castlibList[r] = [cl, fname, newpath, newpathDir]5203 5204 else5205 5206 -- must be something REALLY wrong, as the filename should ALWAYS be of any length (internal castlibs )5207 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5208 return 05209 5210 end if5211 5212 end repeat5213 5214 5215 the itemdelimiter = olddelim5216 5217 else5218 5219 castlibListCnt = count(castlibList)5220 repeat with r = 1 to castlibListCnt5221 cl = castlibList[r]5222 newpath = fname5223 castlibList[cl] = [cl, fname, fname]5224 end repeat5225 5226 end if5227 ---------------------------------------5228 5229 5230 ---------------------------------------5231 if the platform contains "mac" then5232 svnBinary = baUnixName(svnBinary)5233 workingFolder = baUnixName(workingFolder)5234 5235 castlibListCnt = count(castlibList)5236 repeat with r = 1 to castlibListCnt5237 castlibList[r][3] = baUnixName(castlibList[r][3])5238 end repeat5239 5240 else5241 if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder5242 end if5243 ---------------------------------------5244 5245 5246 isChanged = 05247 castlibListCnt = count(castlibList)5248 repeat with r = 1 to castlibListCnt5249 -- cl = castlibList[r]5250 -- repeat with cl in castlibList5251 ---------------------------------------5252 5253 mDisplayWaitStatusText me, "SVN update of:" && castlibList[r][3]5254 5255 theresult = shell_cmd_list(svnBinary && "update" && QUOTE & castlibList[r][3] & QUOTE)5256 5257 if count(theresult) < 1 then5258 theresult = shell_cmd_list(svnBinary && "update" && QUOTE & castlibList[r][3] & QUOTE && "2>&1")5259 if count(theresult) < 1 then5260 theError = theresult[1]5261 else5262 theError = "svn did not respond at all."5263 end if5264 alert "Can't proceed svn error while trying to update:" && theError5265 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5266 return 05267 end if5268 ---------------------------------------5269 5270 5271 5272 theresult = shell_cmd_list(svnBinary && "status" && QUOTE & castlibList[r][3] & QUOTE)5273 5274 cnt = count(theresult)5275 if cnt > 0 then5276 isChanged = 15277 -- alert "Apparently there are no changes to the most recent version in the svn repository: svn status is empty"5278 -- return 05279 end if5280 5281 end repeat5282 5283 if isChanged = 0 then5284 alert "Apparently there are no changes to the most recent version in the svn repository: svn status is empty"5285 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5286 return 05287 end if5288 5289 5290 pathStr = ""5291 castlibListCnt = count(castlibList)5292 repeat with r = 1 to castlibListCnt5293 put " " & QUOTE & castlibList[r][3] & QUOTE after pathStr5294 end repeat5295 5296 5297 mDisplayWaitStatusText me, "SVN commit for:" && pathStr5298 5299 theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE & pathStr)5300 5301 5302 ---------------------------------------5303 if count(theresult) > 0 then5304 theResult = theresult[1]5305 5306 put theResult5307 if dontShowAlert <> 1 then alert "Done, see the results of the svn operation in the message window."5308 5309 else5310 if dontShowAlert <> 1 then alert "svn application did not respond, something seems to have failed. :-("5311 end if5312 ---------------------------------------5313 5314 setPref("svn_wCopies_paths_Binary.txt", string(workingCopies))5315 5316 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5317 5318 return 15319 5320 end5321 5322 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5323 5324 on mSVN_Commit_CurrentMovie_Binaries me, chooseNewPath, commitMsg, dontSave, dontShowAlert5325 5326 workingCopies = value(getPref("svn_wCopies_paths_Binary.txt"))5327 if ilk(workingCopies) <> #proplist then workingCopies = [:]5328 5329 svnBinary = mGetSVNBinaryPath(me, workingCopies)5330 if length(svnBinary) < 1 then return 05331 5332 workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies binaries (director files). Please select a working copy of the director files.")5333 if length(workingFolder) < 1 then return 05334 5335 5336 ---------------------------------------5337 msg = string(commitMsg)5338 if length(msg) < 1 then5339 msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2)5340 5341 if length(msg) < 1 then5342 alert "You must enter a message for the commit action."5343 return 05344 end if5345 end if5346 ---------------------------------------5347 5348 5349 ---------------------------------------5350 if dontSave <> 1 then5351 -- this flag is only for the case, we come here from the combined commit call "mSVN_Commit_CurrentMovie_Binaries_AND_Scripttext"5352 -- as the movie was already saved in "mSVN_Commit_CurrentScripts_ScriptText"5353 5354 if workingCopies.getaprop(#dontWarnWhenSaving) <> 1 then5355 answer = baMsgBoxEx("The movie will be saved before committing.", "Save movie?", "Save", "Cancel", "Always save", "Question", 1, "left", "Arial", 14, 4, -2, -2)5356 if answer = "Cancel" then return 05357 if answer = "Always save" then workingCopies.setaprop(#dontWarnWhenSaving, 1)5358 end if5359 5360 statusSwitched = mSwitchToStatusMode(me, 1)5361 5362 mDisplayWaitStatusText me, "Saving movie..."5363 5364 saveMovie()5365 5366 else5367 5368 statusSwitched = mSwitchToStatusMode(me, 1)5369 5370 end if5371 ----------------------------------------5372 5373 5374 5375 ---------------------------------------5376 if workingFolder <> the moviepath then5377 erg = baCopyFileProgress(the moviepath & the moviename, workingFolder & the moviename, "Always", "Copying movie to working folder", "", 33)5378 if erg <> 0 then5379 alert "An error occurred during copying the movie:" && erg5380 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5381 return 05382 end if5383 clnum = the number of castlibs5384 mp = the moviepath5385 mplen = length(mp)5386 olddelim = the itemdelimiter5387 the itemdelimiter = mp5388 repeat with n = 2 to clnum5389 fname = castlib(n).filename5390 if length(fname) > 0 then5391 5392 if the moviepath & the moviename <> fname then5393 offs = offset(mp, fname)5394 if offs <> 1 then5395 alert "Castlib" && castlib(n) && "is not within your current moviepath. This is not supported."5396 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5397 return 05398 end if5399 relpath = fname5400 delete char 1 to mplen of relpath5401 5402 newpath = workingFolder & relpath5403 newpathDir = newpath5404 delete the last item of newpathDir5405 if baFolderExists(newpathDir) <> 1 then baCreateFolder(newpathDir)5406 baCopyFileProgress(fname, newpath, "Always", "Copying castlib " & n & " to working folder", "", 33)5407 5408 end if5409 5410 end if5411 end repeat5412 the itemdelimiter = olddelim5413 end if5414 ---------------------------------------5415 5416 ---------------------------------------5417 if the platform contains "mac" then5418 svnBinary = baUnixName(svnBinary)5419 workingFolder = baUnixName(workingFolder)5420 else5421 if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder5422 end if5423 ---------------------------------------5424 5425 5426 ---------------------------------------5427 mDisplayWaitStatusText me, "SVN update for:" && workingFolder5428 5429 theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE)5430 5431 if count(theresult) < 1 then5432 theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE && "2>&1")5433 if count(theresult) < 1 then5434 theError = theresult[1]5435 else5436 theError = "svn did not respond at all."5437 end if5438 alert "Can't proceed svn error while trying to update:" && theError5439 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5440 return 05441 end if5442 ---------------------------------------5443 5444 5445 ------- NOW, basically there are two options, one is only commiting the files, which we have copied (director movie and castlibs)5446 ------- OR commit the whole folder (-> everything, which is changed or added to <workingFolder>)5447 ------- The problem regarding option #1, is that it would be a new revision for each file -> ugly5448 ------- #2 however "messes" with files, which the user may not expect...5449 ------- I for one prefer #2 anyway, therefore I didn't even implement #15450 ------- in order to implement #1 you can use a repeat loop just like the above repeat, which goes thorugh each castlib5451 5452 theresult = shell_cmd_list(svnBinary && "status" && QUOTE & workingFolder & QUOTE)5453 5454 cnt = count(theresult)5455 if cnt < 1 then5456 alert "Apparently there are no changes to the most recent version in the svn repository: svn status is empty"5457 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5458 return 05459 end if5460 5461 repeat with n = 1 to cnt5462 answ = theresult[n]5463 meth = word 1 of answ5464 delete word 1 of answ5465 5466 case meth of5467 "!": -- deleted file (missing here, but in the repository present)5468 -- I don't think, it is a good idea to delete the file in the repository in this case5469 -- as it may also be the case, that we only have a subset of the castlibs/scripts5470 -- therefore I just skip these files and leave it to the user what to do with them in his svn client application5471 -- we only put a message, so the user is made aware of this fact5472 put "Missing file!" && answ && "is missing here, but present in the repository"5473 mDisplayWaitStatusText me, "Missing file!" && answ && "is missing here, but present in the repository"5474 5475 "?": -- newly added file5476 shell_cmd_list(svnBinary && "add" && QUOTE & answ & QUOTE)5477 5478 put "Added file" && answ && "to the repository"5479 mDisplayWaitStatusText me, "Added file" && answ && "to the repository"5480 5481 "m":5482 -- just log the changes:5483 put "Update file:" && answ5484 mDisplayWaitStatusText me, "Update file:" && answ5485 5486 end case5487 5488 end repeat5489 5490 mDisplayWaitStatusText me, "SVN commit of:" && workingFolder5491 5492 theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE && QUOTE & workingFolder & QUOTE)5493 5494 5495 ---------------------------------------5496 if count(theresult) > 0 then5497 theResult = theresult[1]5498 5499 put theResult5500 if dontShowAlert <> 1 then alert "Done, see the results of the svn operation in the message window."5501 5502 else5503 if dontShowAlert <> 1 then alert "svn application did not respond, something seems to have failed. :-("5504 end if5505 ---------------------------------------5506 5507 setPref("svn_wCopies_paths_Binary.txt", string(workingCopies))5508 5509 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5510 5511 return 15512 end5513 5514 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5515 5516 on mSVN_Update_SelectedCastlib me, chooseNewPath, onlyUpdate_SVN_WorkingFolder, dontShowAlert5517 5518 actCL = the activecastlib5519 5520 workingCopies = value(getPref("svn_wCopies_paths_Binary.txt"))5521 if ilk(workingCopies) <> #proplist then workingCopies = [:]5522 5523 svnBinary = mGetSVNBinaryPath(me, workingCopies)5524 if length(svnBinary) < 1 then exit5525 5526 workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies binaries (director files). Please select a working copy of the director files.")5527 if length(workingFolder) < 1 then exit5528 5529 5530 5531 oldmoviepath = the moviepath5532 oldmovie = oldmoviepath & the moviename5533 5534 5535 fname = castlib(actCL).filename5536 5537 ---------------------------------------5538 if workingFolder <> the moviepath then5539 5540 mp = the moviepath5541 mplen = length(mp)5542 olddelim = the itemdelimiter5543 the itemdelimiter = mp5544 5545 if length(fname) > 0 then5546 5547 offs = offset(mp, fname)5548 if offs <> 1 then5549 alert "Castlib" && castlib(actCL) && "is not within your current moviepath. This is not supported."5550 return 05551 end if5552 5553 relpath = fname5554 delete char 1 to mplen of relpath5555 5556 newpath = workingFolder & relpath5557 newpathDir = newpath5558 delete the last item of newpathDir5559 -- if baFolderExists(newpathDir) <> 1 then baCreateFolder(newpathDir)5560 -- baCopyFileProgress(fname, newpath, "Always", "Copying castlib " & actCL & " to working folder", "", 33)5561 5562 else5563 5564 -- musty something REALLY wrong, as the filename should ALWAYS be of any length (internal castlibs )5565 return 05566 5567 end if5568 5569 the itemdelimiter = olddelim5570 5571 else5572 5573 newpath = fname5574 end if5575 ---------------------------------------5576 5577 5578 statusSwitched = mSwitchToStatusMode(me, 1)5579 5580 5581 doReturnToOldMovie = 05582 5583 if (onlyUpdate_SVN_WorkingFolder <> 1) or (the moviepath contains workingFolder) then5584 5585 mDisplayWaitStatusText me, "Temporary switch to new movie in order to replace files"5586 5587 ------------------------------5588 -- close this movie by issuing a "new movie..." command5589 -- in order to replace the current movie, with the updated movie5590 dispatchcommand(4097)5591 ------------------------------5592 5593 doReturnToOldMovie = 15594 5595 end if5596 5597 5598 5599 if the platform contains "mac" then5600 svnBinary = baUnixName(svnBinary)5601 workingFolderUnix = baUnixName(workingFolder)5602 newpathUnix = baUnixName(newpath)5603 else5604 newpathUnix = newpath5605 workingFolderUnix = workingFolder5606 if the last char of workingFolderUnix = the last char of the applicationpath then delete the last char of workingFolderUnix5607 end if5608 5609 5610 mDisplayWaitStatusText me, "SVN update:" && newpathUnix5611 5612 theresult = shell_cmd_list(svnBinary && "update" && QUOTE & newpathUnix & QUOTE)5613 5614 5615 if count(theresult) > 0 then5616 5617 -------- reload the refreshed movie:5618 if the moviepath contains workingFolder then5619 5620 -- go to movie the moviepath & the moviename5621 5622 else5623 5624 if onlyUpdate_SVN_WorkingFolder <> 1 then5625 5626 -------------------------- now get the updated movies over here:5627 if the last char of workingFolder <> the last char of the applicationpath then put the last char of the applicationpath after workingFolder5628 5629 put "Copy file from " & workingFolder & " to " & oldmoviepath5630 5631 5632 erg = baCopyFileProgress(newpath, fname, "Always", "Replacing castlib with the version of the working folder", "", 33)5633 if erg <> 0 then5634 alert "An error occurred during copying the file (" & newpath & "). Error:" && erg5635 else5636 put "Replaced file:" && newpath5637 end if5638 5639 5640 ----------------------------------5641 5642 end if5643 5644 end if5645 5646 put theresult[1]5647 5648 if doReturnToOldMovie = 1 then go to movie oldmovie5649 5650 if dontShowAlert <> 1 then alert "Done, see the results of the svn operation in the message window."5651 5652 else5653 5654 if doReturnToOldMovie = 1 then go to movie oldmovie5655 5656 if dontShowAlert <> 1 then alert "svn application did not respond, something seems to have failed. :-("5657 end if5658 5659 5660 setPref("svn_wCopies_paths_Binary.txt", string(workingCopies))5661 5662 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5663 5664 end5665 5666 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5667 5668 on mSVN_Update_CurrentMovie_Binaries me, chooseNewPath, onlyUpdate_SVN_WorkingFolder, dontShowAlert5669 5670 workingCopies = value(getPref("svn_wCopies_paths_Binary.txt"))5671 if ilk(workingCopies) <> #proplist then workingCopies = [:]5672 5673 svnBinary = mGetSVNBinaryPath(me, workingCopies)5674 if length(svnBinary) < 1 then exit5675 5676 workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies binaries (director files). Please select a working copy of the director files.")5677 if length(workingFolder) < 1 then exit5678 5679 5680 statusSwitched = mSwitchToStatusMode(me, 1)5681 5682 5683 if the platform contains "mac" then5684 svnBinary = baUnixName(svnBinary)5685 workingFolderUnix = baUnixName(workingFolder)5686 else5687 workingFolderUnix = workingFolder5688 if the last char of workingFolderUnix = the last char of the applicationpath then delete the last char of workingFolderUnix5689 end if5690 5691 oldmoviepath = the moviepath5692 oldmovie = oldmoviepath & the moviename5693 5694 5695 doReturnToOldMovie = 05696 5697 if (onlyUpdate_SVN_WorkingFolder <> 1) or (the moviepath contains workingFolder) then5698 5699 5700 mDisplayWaitStatusText me, "Temporary switch to new movie in order to replace files"5701 5702 ------------------------------5703 -- close this movie by issuing a "new movie..." command5704 -- in order to replace the current movie, with the updated movie5705 dispatchcommand(4097)5706 ------------------------------5707 5708 doReturnToOldMovie = 15709 5710 end if5711 5712 mDisplayWaitStatusText me, "SVN update:" && workingFolderUnix5713 5714 theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolderUnix & QUOTE)5715 5716 if count(theresult) > 0 then5717 5718 -------- reload the refreshed movie:5719 if the moviepath contains workingFolder then5720 5721 -- go to movie the moviepath & the moviename5722 5723 else5724 5725 if onlyUpdate_SVN_WorkingFolder <> 1 then5726 5727 -------------------------- now get the updated movies over here:5728 if the last char of workingFolder <> the last char of the applicationpath then put the last char of the applicationpath after workingFolder5729 5730 put "Copy files from " & workingFolder & " to " & oldmoviepath5731 mCopyAllFiles(me, workingFolder, oldmoviepath)5732 5733 ----------------------------------5734 5735 end if5736 5737 end if5738 5739 put theresult[1]5740 5741 if doReturnToOldMovie = 1 then go to movie oldmovie5742 5743 if dontShowAlert <> 1 then alert "Done, see the results of the svn operation in the message window."5744 5745 else5746 5747 if doReturnToOldMovie = 1 then go to movie oldmovie5748 5749 if dontShowAlert <> 1 then alert "svn application did not respond, something seems to have failed. :-("5750 end if5751 5752 5753 setPref("svn_wCopies_paths_Binary.txt", string(workingCopies))5754 5755 5756 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5757 5758 end5759 5760 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5761 5762 on mCopyAllFiles me, fromFolder, toFolder5763 5764 flist = baFolderList(fromFolder)5765 flistCnt = count(flist)5766 repeat with n = flistCnt down to 15767 thisFolder = flist[n]5768 if thisFolder starts ".svn" then next repeat5769 if not(baFolderExists(toFolder & thisFolder)) then5770 put "Attempting to create folder:" && toFolder & thisFolder5771 erg = baCreateFolder(toFolder & thisFolder)5772 5773 if erg = 0 then put "successfully created folder"5774 else put "Unable to create folder."5775 5776 else5777 erg = 15778 end if5779 5780 if erg = 1 then5781 mCopyAllFiles me, fromFolder & thisFolder & the last char of toFolder, toFolder & thisFolder & the last char of toFolder5782 else5783 alert "Unable to create folder (" & thisFolder & "). Error:" && erg5784 end if5785 5786 end repeat5787 5788 5789 5790 flist = baFileList(fromFolder, "")5791 flistCnt = count(flist)5792 repeat with n = 1 to flistCnt5793 thisFile = flist[n]5794 if thisFile starts ".svn" then next repeat5795 erg = baCopyFileProgress(fromFolder & thisFile, toFolder & thisFile, "Always", "Replacing movie with the version of the working folder", "", 33)5796 if erg <> 0 then5797 alert "An error occurred during copying the file (" & thisFile & "). Error:" && erg5798 else5799 put "Replaced file:" && thisFile5800 end if5801 end repeat5802 5803 5804 end5805 5806 5807 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx5808 5809 on mSVN_Commit_CurrentScripts_ScriptText me, selected_Members_Only, chooseNewPath, commitMsg, dontShowAlert, selectionList5810 5811 workingCopies = value(getPref("svn_workingCopies_paths.txt"))5812 if ilk(workingCopies) <> #proplist then workingCopies = [:]5813 5814 svnBinary = mGetSVNBinaryPath(me, workingCopies)5815 if length(svnBinary) < 1 then return 05816 5817 workingFolder = mGetWorkingCopyPath(me, the moviepath & the moviename, chooseNewPath, workingCopies, "No working copy is specified for this movies scripttext. Please select a working copy for the scripttext now.")5818 if length(workingFolder) < 1 then return 05819 5820 msg = string(commitMsg)5821 5822 5823 if length(msg) < 1 then5824 5825 msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2)5826 5827 if length(msg) < 1 then5828 alert "You must enter a message for the commit action."5829 return 05830 end if5831 5832 end if5833 5834 5835 if workingCopies.getaprop(#dontWarnWhenSaving) <> 1 then5836 answer = baMsgBoxEx("The movie will be saved before committing.", "Save movie?", "Save", "Cancel", "Always save", "Question", 1, "left", "Arial", 14, 4, -2, -2)5837 if answer = "Cancel" then return 05838 if answer = "Always save" then workingCopies.setaprop(#dontWarnWhenSaving, 1)5839 end if5840 5841 5842 5843 statusSwitched = mSwitchToStatusMode(me, 1)5844 5845 clibfolder = ""5846 5847 castlibList = 05848 5849 5850 5851 -------- if we work on only one castlib:5852 5853 if ilk(selected_Members_Only) = #castLib then5854 5855 5856 -----------------------------------------------------5857 5858 selectionList = string(selectionList)5859 if length(selectionList) > 0 then5860 5861 if char 1 of selectionList <> "[" then put "[" before selectionList5862 if the last char of selectionList <> "]" then put "]" after selectionList5863 5864 selectionList = value(selectionList)5865 if listP(selectionList) then5866 clnum = the number of castlibs + 15867 castlibList = []5868 selectionListCnt = count(selectionList)5869 repeat with n = 1 to selectionListCnt5870 int = integer(selectionList[n])5871 if integerP(int) then5872 if clnum > int then5873 if castlibList.getPos(int) < 1 then castlibList.add(int)5874 end if5875 end if5876 end repeat5877 end if5878 end if5879 5880 if castlibList = 0 then5881 castlibList = []5882 castlibList.add(selected_Members_Only.number)5883 end if5884 5885 5886 mpname = the moviepath & the moviename5887 isInternal = 05888 repeat with cl in castlibList5889 if castlib(cl).filename = mpname then5890 isInternal = 15891 exit repeat5892 end if5893 end repeat5894 5895 5896 if count(castlibList) < 1 then5897 alert "No castlib selected. The parameter didn't yiled a valid list. Make sure, that you provide a linear list with integers, specifying a number of a castlib each."5898 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)5899 return 05900 end if5901 5902 5903 5904 mDisplayWaitStatusText me, "Commiting scripttext for castlibs:" && castlibList5905 5906 put "Commiting scripttext for castlibs:" && castlibList5907 -----------------------------------------------------5908 5909 delim = the last char of the applicationpath5910 5911 olddelim = the itemdelimiter5912 the itemdelimiter = delim5913 5914 repeat with n = count(castlibList) down to 15915 5916 selected_Members_Only = castlib(castlibList[n])5917 5918 mDisplayWaitStatusText me, "Saving castlib:" && selected_Members_Only5919 5920 selected_Members_Only.save()5921 5922 5923 5924 if the last item of workingFolder = "castlib" & selected_Members_Only.number then5925 clibfolder = workingFolder5926 else5927 if the last char of workingFolder <> delim then put delim after workingFolder5928 clibfolder = workingFolder & "castlib" & selected_Members_Only.number5929 end if5930 5931 castlibList[n] = [castlibList[n], clibfolder, workingFolder]5932 --------5933 5934 5935 mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder5936 5937 end repeat5938 5939 the itemdelimiter = olddelim5940 5941 5942 5943 else -- treat all:5944 5945 mDisplayWaitStatusText me, "Saving movie..."5946 5947 saveMovie()5948 5949 mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder5950 5951 castlibList = 05952 5953 end if5954 5955 5956 5957 if castlibList = 0 then5958 5959 -------- if we work on only one castlib:5960 if length(clibfolder) > 0 then workingFolder = clibfolder5961 --------5962 5963 5964 if the platform contains "mac" then5965 svnBinary = baUnixName(svnBinary)5966 workingFolder = baUnixName(workingFolder)5967 else5968 if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder5969 end if5970 5971 5972 workingFolder = " " & QUOTE & workingFolder & QUOTE5973 5974 else5975 5976 if the platform contains "mac" then svnBinary = baUnixName(svnBinary)5977 cnt = count(castlibList)5978 5979 workingFolder = ""5980 5981 repeat with n = 1 to cnt5982 5983 if the platform contains "mac" then5984 castlibList[n][3] = baUnixName(castlibList[n][3])5985 else5986 str = castlibList[n][3]5987 if the last char of str = the last char of the applicationpath then5988 delete the last char of str5989 castlibList[n][3] = str5990 end if5991 end if5992 5993 put " " & QUOTE & castlibList[n][3] & QUOTE after workingFolder5994 5995 end repeat5996 5997 end if5998 5999 6000 mDisplayWaitStatusText me, "SVN update of:" && workingFolder6001 6002 6003 theresult = shell_cmd_list(svnBinary && "update" & workingFolder)6004 6005 6006 if count(theresult) < 1 then6007 theresult = shell_cmd_list(svnBinary && "update" & workingFolder && "2>&1")6008 if count(theresult) < 1 then6009 theError = theresult[1]6010 else6011 theError = "svn did not respond at all."6012 end if6013 alert "Can't proceed svn error while trying to update:" && theError6014 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)6015 return 06016 end if6017 6018 theresult = shell_cmd_list(svnBinary && "status" & workingFolder)6019 6020 cnt = count(theresult)6021 if cnt < 1 then6022 alert "Apparently there are no changes to the scripts of the most recent version in the svn repository: svn status is empty"6023 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)6024 return 06025 end if6026 6027 repeat with n = 1 to cnt6028 answ = theresult[n]6029 meth = word 1 of answ6030 delete word 1 of answ6031 6032 case meth of6033 "!": -- deleted file (missing here, but in the repository present)6034 -- I don't think, it is a good idea to delete the file in the repository in this case6035 -- as it may also be the case, that we only have a subset of the castlibs/scripts6036 -- therefore I just skip these files and leave it to the user what to do with them in his svn client application6037 -- we only put a message, so the user is made aware of this fact6038 put "Missing file!" && answ && "is missing here, but present in the repository"6039 6040 mDisplayWaitStatusText me, "Missing file!" && answ && "is missing here, but present in the repository"6041 6042 6043 "?": -- newly added file6044 shell_cmd_list(svnBinary && "add" && QUOTE & answ & QUOTE)6045 6046 put "Added file" && answ && "to the repository"6047 6048 mDisplayWaitStatusText me, "Added file" && answ && "to the repository"6049 6050 "m":6051 -- just log the changes:6052 put "Update file:" && answ6053 6054 mDisplayWaitStatusText me, "Update file:" && answ6055 6056 end case6057 6058 end repeat6059 6060 mDisplayWaitStatusText me, "SVN commit:" && workingFolder6061 6062 theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE & workingFolder)6063 6064 6065 if count(theresult) > 0 then6066 theResult = theresult[1]6067 6068 put theResult6069 6070 6071 if dontShowAlert <> 1 then6072 alert "Done, see the results of the svn operation in the message window."6073 end if6074 6075 else6076 alert "svn application did not respond, something seems to have failed, while commiting the scripttext. :-("6077 end if6078 6079 6080 setPref("svn_workingCopies_paths.txt", string(workingCopies))6081 6082 6083 if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0)6084 6085 return 16086 6087 end6088 6089 6090 6091 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6092 ---------- svn helper handlers6093 6094 on mGetSVNBinaryPath me, workingCopies6095 6096 if (mCheckForXtra(me, "budapi") + mCheckForXtra(me, "shell")) < 2 then6097 alert "You need the shell xtra and the buddyApi xtra in order to proceed"6098 return ""6099 end if6100 6101 savePrefs = 06102 if ilk(workingCopies) <> #proplist then6103 workingCopies = value(getPref("svn_workingCopies_paths.txt"))6104 if ilk(workingCopies) <> #proplist then workingCopies = [:]6105 savePrefs = 16106 end if6107 6108 6109 if the platform contains "mac" then6110 svnBinary = baHFSName(string(workingCopies.getaprop(#svnBinary)))6111 else6112 svnBinary = string(workingCopies.getaprop(#svnBinary))6113 end if6114 6115 if the platform contains "mac" then -- dunno how to check on windows, if svn is installed, anyone ?6116 6117 if baFileExists(svnBinary) <> 1 then svnBinary = ""6118 6119 6120 if length(svnBinary) < 1 then6121 6122 svnBinary = []6123 6124 svnBinary = shell_cmd_list("for thisBinPath in /usr/bin /bin /usr/sbin /sbin /usr/local/sbin /usr/local/bin /opt/sbin /opt/bin /opt/local/sbin /opt/local/bin /sw/bin /sw/sbin ; do find $thisBinPath -name svn ; done")6125 -- end if6126 6127 if count(svnBinary) < 1 then6128 alert "svn binary not found in your binaries folder. Where is the svn binary?"6129 svnBinary = mGetFilePathFromUser(me)6130 if length(svnBinary) < 1 then return ""6131 6132 else6133 svnBinary = baHFSName(svnBinary[1])6134 6135 end if6136 6137 6138 end if6139 6140 if baFileExists(svnBinary) <> 1 then6141 alert "The path to the svn binary seems to have changed. Please try again in order to search the path."6142 svnBinary = ""6143 end if6144 6145 6146 else6147 -- dunno how to check on windows, if svn is installed, anyone ?6148 svnBinary = "svn"6149 end if6150 6151 6152 workingCopies.setaprop(#svnBinary, svnBinary)6153 6154 if savePrefs = 1 then setPref("svn_workingCopies_paths.txt", string(workingCopies))6155 6156 return svnBinary6157 6158 end6159 6160 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6161 6162 on mGetWorkingCopyPath me, movieIdentifier, chooseNewPath, workingCopies, selectMsg6163 6164 movieIdentifier = string(movieIdentifier)6165 if length(movieIdentifier) < 1 then6166 movieIdentifier = the moviepath & the moviename6167 end if6168 6169 savePrefs = 06170 if ilk(workingCopies) <> #proplist then6171 workingCopies = value(getPref("svn_workingCopies_paths.txt"))6172 if ilk(workingCopies) <> #proplist then workingCopies = [:]6173 savePrefs = 16174 end if6175 6176 workingFolder = string(workingCopies.getaprop(movieIdentifier))6177 6178 if length(workingFolder) > 0 then6179 if baFolderExists(workingFolder) <> 1 then6180 workingFolder = ""6181 end if6182 end if6183 6184 6185 if chooseNewPath = 1 then6186 workingFolder = baGetFolder(the moviepath, "Please select a working copy for SVN update", 3, "Select working copy", -2, -2)6187 end if6188 6189 if workingFolder = "" then6190 6191 selectMsg = string(selectMsg)6192 if length(selectMsg) < 1 then selectMsg = "No working copy is specified for this movie. Please select a working copy now."6193 6194 alert selectMsg6195 6196 workingFolder = baGetFolder(the moviepath, "Please select a working copy for SVN update", 3, "Select working copy", -2, -2)6197 end if6198 6199 if length(workingFolder) < 1 then return ""6200 6201 delim = the last char of the applicationpath6202 if the last char of workingFolder <> delim then put delim after workingFolder6203 6204 if baFolderExists(workingFolder & ".svn") <> 1 then6205 6206 alert workingFolder && "does not appear to be a svn working copy."6207 6208 workingCopies.deleteprop(movieIdentifier)6209 6210 return ""6211 end if6212 6213 workingCopies.setaprop(movieIdentifier, workingFolder)6214 6215 if savePrefs = 1 then setPref("svn_workingCopies_paths.txt", string(workingCopies))6216 6217 return workingFolder6218 6219 end6220 6221 6222 6223 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6224 2253 on _______________GLOSSARY_ITEMS me 6225 2254 end 6226 2255 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 6227 2256 6228 6229 6230 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx6231 2257 6232 2258 on pasteDate me -
trunk/lingosource/castlib1/convert_Lingo_2_CSS_Html.ls
r63 r74 22 22 sel = the selection of castlib cl 23 23 if not sel.count then 24 alert "Please select a #text member to convert"24 alert "Please copy+paste scripttext into a #text member and select the #text member to convert the lingo into html with CSS." 25 25 exit 26 26 end if 27 27 memref = member(sel[1][1], cl) 28 28 if [#text, #field].getPos(memref.type) < 1 then 29 alert "Please select a #text member to convert"29 alert "Please copy+paste scripttext into a #text member and select the #text member to convert the lingo into html with CSS." 30 30 exit 31 31 end if -
trunk/lingosource/castlib1/memberInfo.xml
r63 r74 5 5 <comments></comments> 6 6 <memberName>thisMoviesScript</memberName> 7 <f Name>thisMoviesScript</fName>7 <fname>thisMoviesScript</fname> 8 8 </thisMoviesScript> 9 9 <keyboardNavigation_FrameLoop> … … 11 11 <comments></comments> 12 12 <memberName>keyboardNavigation_FrameLoop</memberName> 13 <f Name>keyboardNavigation_FrameLoop</fName>13 <fname>keyboardNavigation_FrameLoop</fname> 14 14 </keyboardNavigation_FrameLoop> 15 15 <menu1_button> … … 17 17 <comments></comments> 18 18 <memberName>menu1_button</memberName> 19 <f Name>menu1_button</fName>19 <fname>menu1_button</fname> 20 20 </menu1_button> 21 21 <menu2_button> … … 23 23 <comments></comments> 24 24 <memberName>menu2_button</memberName> 25 <f Name>menu2_button</fName>25 <fname>menu2_button</fname> 26 26 </menu2_button> 27 27 <simpleBMMenu> … … 29 29 <comments></comments> 30 30 <memberName>simpleBMMenu</memberName> 31 <f Name>simpleBMMenu</fName>31 <fname>simpleBMMenu</fname> 32 32 </simpleBMMenu> 33 33 <OSCmenu_Utilities> … … 35 35 <comments></comments> 36 36 <memberName>OSCmenu_Utilities</memberName> 37 <f Name>OSCmenu_Utilities</fName>37 <fname>OSCmenu_Utilities</fname> 38 38 </OSCmenu_Utilities> 39 39 <alexUtilities> … … 41 41 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 42 42 <memberName>alexUtilities</memberName> 43 <f Name>alexUtilities</fName>43 <fname>alexUtilities</fname> 44 44 </alexUtilities> 45 45 <convert_Lingo_2_CSS_Html> … … 47 47 <comments>~/Documents/Scripts/lingo/convert_Lingo_2_CSS_Html.ls</comments> 48 48 <memberName>convert_Lingo_2_CSS_Html</memberName> 49 <f Name>convert_Lingo_2_CSS_Html</fName>49 <fname>convert_Lingo_2_CSS_Html</fname> 50 50 </convert_Lingo_2_CSS_Html> 51 51 <OSCmenu_Handlers> … … 53 53 <comments></comments> 54 54 <memberName>OSCmenu_Handlers</memberName> 55 <f Name>OSCmenu_Handlers</fName>55 <fname>OSCmenu_Handlers</fname> 56 56 </OSCmenu_Handlers> 57 57 <pastefeld> … … 59 59 <comments></comments> 60 60 <memberName>pastefeld</memberName> 61 <f Name>pastefeld</fName>61 <fname>pastefeld</fname> 62 62 </pastefeld> 63 63 <oldclipboard> … … 65 65 <comments></comments> 66 66 <memberName>oldclipboard</memberName> 67 <f Name>oldclipboard</fName>67 <fname>oldclipboard</fname> 68 68 </oldclipboard> 69 69 <searchword> … … 71 71 <comments></comments> 72 72 <memberName>searchword</memberName> 73 <f Name>searchword</fName>73 <fname>searchword</fname> 74 74 </searchword> 75 75 <resizewindowfs> … … 77 77 <comments></comments> 78 78 <memberName>resizewindowfs</memberName> 79 <f Name>resizewindowfs</fName>79 <fname>resizewindowfs</fname> 80 80 </resizewindowfs> 81 81 <showHideHelp> … … 83 83 <comments></comments> 84 84 <memberName>showHideHelp</memberName> 85 <f Name>showHideHelp</fName>85 <fname>showHideHelp</fname> 86 86 </showHideHelp> 87 87 <helptext> … … 92 92 rtf</comments> 93 93 <memberName>helptext</memberName> 94 <f Name>helptext</fName>94 <fname>helptext</fname> 95 95 </helptext> 96 96 <texthyperlinkBehavior> … … 98 98 <comments>/Users/alex/Documents/ALIEN/myLinkedScripts/texthyperlinkBehavior.ls</comments> 99 99 <memberName>texthyperlinkBehavior</memberName> 100 <f Name>texthyperlinkBehavior</fName>100 <fname>texthyperlinkBehavior</fname> 101 101 </texthyperlinkBehavior> 102 102 <bbdiff> … … 104 104 <comments></comments> 105 105 <memberName>bbdiff</memberName> 106 <f Name>bbdiff</fName>106 <fname>bbdiff</fname> 107 107 </bbdiff> 108 108 <statusOutput> … … 113 113 rtf</comments> 114 114 <memberName>statusOutput</memberName> 115 <f Name>statusOutput</fName>115 <fname>statusOutput</fname> 116 116 </statusOutput> 117 <bbedit_Utilities> 118 <scriptType>#parent</scriptType> 119 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 120 <memberName>bbedit_Utilities</memberName> 121 <fname>bbedit_Utilities</fname> 122 </bbedit_Utilities> 123 <svn_Utilities> 124 <scriptType>#parent</scriptType> 125 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 126 <memberName>svn_Utilities</memberName> 127 <fname>svn_Utilities</fname> 128 </svn_Utilities> 117 129 </Untitled> -
trunk/lingosource/castlib2/FileIOFunktionen.ls
r37 r74 106 106 if call(#mCheckForXtra, mGetXScript(), "BudAPI") = 1 then 107 107 startfolder = string(startfolder) 108 109 resetUNames = 0 110 if the platform contains "mac" then 111 if baSysFolder("prefs") starts "/" then 112 baReturnUnixNames(0) 113 resetUNames = 1 114 end if 115 end if 108 116 if length(startfolder) > 0 then 109 117 pfad = baGetFilename("save", startfolder, theDefaultName, "", 524288+2+4+4194304, theTitle, false, -1, -1) … … 111 119 pfad = baGetFilename("save", "", theDefaultName, "", 524288+2+4+4194304, theTitle, false, -1, -1) 112 120 end if 121 122 if resetUNames = 1 then baReturnUnixNames(1) 123 113 124 else 114 125 pfad = fio.displaySave(theTitle, theDefaultName) … … 275 286 if call(#mCheckForXtra, mGetXScript(), "BudAPI") = 1 then 276 287 288 resetUNames = 0 289 if the platform contains "mac" then 290 if baSysFolder("prefs") starts "/" then 291 baReturnUnixNames(0) 292 resetUNames = 1 293 end if 294 end if 295 277 296 startDir = string(startDir) 278 297 defaultName = string(defaultName) … … 281 300 prompt = string(prompt) 282 301 283 return baGetFilename("open", startDir, defaultName, filetypes, 524288+4+2+4194304, prompt, false, -2, -1) 302 retval = baGetFilename("open", startDir, defaultName, filetypes, 524288+4+2+4194304, prompt, false, -2, -1) 303 304 if resetUNames = 1 then baReturnUnixNames(1) 305 306 return retval 284 307 285 308 else … … 307 330 308 331 if xscr().mCheckForXtra("BudAPI") = 1 then -- if buddy is present... 332 333 resetUNames = 0 334 if the platform contains "mac" then 335 if baSysFolder("prefs") starts "/" then 336 baReturnUnixNames(0) 337 resetUNames = 1 338 end if 339 end if 340 309 341 retval = baGetFolder( "", "Select a folder", 3, "", 50, 50 ) 342 343 if resetUNames = 1 then baReturnUnixNames(1) 344 310 345 else if xscr().mCheckForXtra("FileXtra4") = 1 then -- if not buddy then try filextra 311 346 fx = (xtra "filextra4").new() … … 340 375 341 376 if xscr().mCheckForXtra("BudAPI") then -- if buddy is present... 377 342 378 -- -- budApi version: 343 379 retval = baFileList(folderpath, "*.*") -
trunk/lingosource/castlib2/GetSetPrefs.ls
r63 r74 85 85 thePrefs = "" 86 86 else 87 88 resetUNames = 0 89 if the platform contains "mac" then 90 if baSysFolder("prefs") starts "/" then 91 baReturnUnixNames(0) 92 resetUNames = 1 93 end if 94 end if 95 87 96 prefspath = baSysFolder("prefs") 97 98 if resetUNames = 1 then baReturnUnixNames(1) 99 88 100 thePath = prefspath & prefsname 89 101 fio.openfile(thePath, 1) … … 249 261 if objectP(fio) then 250 262 263 resetUNames = 0 264 if the platform contains "mac" then 265 if baSysFolder("prefs") starts "/" then 266 baReturnUnixNames(0) 267 resetUNames = 1 268 end if 269 end if 270 251 271 prefpfad = baSysFolder("prefs")&prefsname 272 273 if resetUNames = 1 then baReturnUnixNames(1) 252 274 253 275 fio.openfile(prefpfad, 1) -
trunk/lingosource/castlib2/PseudoXMLPS.ls
r63 r74 121 121 122 122 -- Example: 123 -- saveString = mGetXMLStringFromList( lingo_list, "documentName")123 -- saveString = mGetXMLStringFromList(me, lingo_list, "documentName") 124 124 125 125 on mGetXMLStringFromList me, listref, docName, strict, dontReplaceGT, withParams … … 157 157 158 158 -- Example: 159 -- lingo_list = mGetListFromXMLString( saveString)159 -- lingo_list = mGetListFromXMLString(me, saveString) 160 160 161 161 on mGetListFromXMLString me, str, convertValues, withParams … … 993 993 994 994 else 995 xscr().mPut("mParseExcelXML: Row "&n&" Cell "&m&" is not a property list")995 call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Row "&n&" Cell "&m&" is not a property list") 996 996 end if -- if ilk(thisCell) = #proplist then 997 997 … … 999 999 1000 1000 else 1001 xscr().mPut("mParseExcelXML: Row "&n&" is not a list")1001 call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Row "&n&" is not a list") 1002 1002 end if -- if listP(currRow) then 1003 1003 … … 1005 1005 1006 1006 else 1007 xscr().mPut("mParseExcelXML: Table not found")1007 call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Table not found") 1008 1008 end if -- if listP(xmlList) then 1009 1009 1010 1010 else 1011 xscr().mPut("mParseExcelXML: Worksheet not found")1011 call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Worksheet not found") 1012 1012 end if -- if ilk(xmlList) = #proplist then 1013 1013 1014 1014 else 1015 xscr().mPut("mParseExcelXML: Workbook not found")1015 call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Workbook not found") 1016 1016 end if -- if ilk(xmlList) = #proplist then 1017 1017 1018 1018 else 1019 xscr().mPut("mParseExcelXML: ROOT is not a property list")1019 call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: ROOT is not a property list") 1020 1020 end if --if ilk(xmlList) = #proplist then 1021 1021 1022 1022 else 1023 xscr().mPut("mParseExcelXML: Xml parser makelist() returned empty list")1023 call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Xml parser makelist() returned empty list") 1024 1024 end if -- if count(xmlList) > 0 then 1025 1025 1026 1026 else 1027 xscr().mPut("mParseExcelXML: Xml parser makelist() failed")1027 call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Xml parser makelist() failed") 1028 1028 end if -- if listP(xmlList) then 1029 1029 1030 1030 else 1031 xscr().mPut("mParseExcelXML: Xml parser error: "&xmlp.getError())1031 call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Xml parser error: "&xmlp.getError()) 1032 1032 end if -- if voidP(xmlp.getError()) then 1033 1033 … … 1234 1234 else 1235 1235 pregex_translate(strli, li[1], li[2]) 1236 1236 1237 end if 1237 1238 -
trunk/lingosource/castlib2/commonMovieScript.ls
r63 r74 319 319 320 320 theGlobs = mGetGlobalList(me) 321 if theGlobs.getaprop(#gCustomKeyHandling) = 1 then return mProcessKeyDownEvent( )321 if theGlobs.getaprop(#gCustomKeyHandling) = 1 then return mProcessKeyDownEvent(tk, kc) 322 322 323 323 retval = 0 … … 1699 1699 1700 1700 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1701 1702 on mValidateEmailAddress me, emailAddress 1703 retval = 0 1704 oldd = the itemdelimiter 1705 the itemdelimiter = "@" 1706 numItems = the number of items of emailAddress 1707 if numitems > 1 then 1708 if length(item 1 of emailAddress) > 0 then 1709 if length(item 2 of emailAddress) > 0 then 1710 offs = offset(".", item 2 of emailAddress) 1711 if offs > 1 then 1712 if offs < (length(item 2 of emailAddress) - 1) then 1713 if offs > (length(item 2 of emailAddress) - 4) then 1714 retval = 1 1715 end if 1716 end if 1717 end if 1718 end if 1719 end if 1720 end if 1721 the itemdelimiter = oldd 1722 return retval 1723 end 1724 1725 1726 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 1701 1727 on ____________CONVERT_CASE 1702 1728 end … … 1784 1810 "it": 1785 1811 li = ["Luned","Marted","Mercoled","Gioved","Venerd","Sabato","Domenica"] 1812 "nl": 1813 li = ["Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag","Zondag"] 1814 "en": 1815 li = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] 1786 1816 otherwise: 1787 li = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]1817 return vN 1788 1818 end case 1789 1819 return li.getAt(vN) -
trunk/lingosource/castlib2/memberInfo.xml
r49 r74 5 5 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 6 6 <memberName>commonMovieScript</memberName> 7 <f Name>commonMovieScript</fName>7 <fname>commonMovieScript</fname> 8 8 </commonmoviescript> 9 9 <FileIOFunktionen> … … 11 11 <comments>~/Documents/Scripts/lingo/FileIOFunktionen.ls</comments> 12 12 <memberName>FileIOFunktionen</memberName> 13 <f Name>FileIOFunktionen</fName>13 <fname>FileIOFunktionen</fname> 14 14 </FileIOFunktionen> 15 15 <GetSetPrefs> … … 17 17 <comments>~/Documents/Scripts/lingo/GetSetPrefs.ls</comments> 18 18 <memberName>GetSetPrefs</memberName> 19 <f Name>GetSetPrefs</fName>19 <fname>GetSetPrefs</fname> 20 20 </GetSetPrefs> 21 21 <aleXtrasMovieScript> … … 23 23 <comments>~/Documents/Scripts/lingo/aleXtrasMovieScript.ls</comments> 24 24 <memberName>aleXtrasMovieScript</memberName> 25 <f Name>aleXtrasMovieScript</fName>25 <fname>aleXtrasMovieScript</fname> 26 26 </aleXtrasMovieScript> 27 27 <PseudoXMLPS> … … 29 29 <comments>~/Documents/Scripts/lingo/PseudoXMLPS.ls</comments> 30 30 <memberName>PseudoXMLPS</memberName> 31 <f Name>PseudoXMLPS</fName>31 <fname>PseudoXMLPS</fname> 32 32 </PseudoXMLPS> 33 33 <simpleGoToAction> … … 35 35 <comments>/Users/alex/Documents/ALIEN/myLinkedScripts/simpleGoToAction.ls</comments> 36 36 <memberName>simpleGoToAction</memberName> 37 <f Name>simpleGoToAction</fName>37 <fname>simpleGoToAction</fname> 38 38 </simpleGoToAction> 39 39 <SpriteNameBeaver> … … 41 41 <comments>~/Documents/Scripts/lingo/SpriteNameBeaver.ls</comments> 42 42 <memberName>SpriteNameBeaver</memberName> 43 <f Name>SpriteNameBeaver</fName>43 <fname>SpriteNameBeaver</fname> 44 44 </SpriteNameBeaver> 45 45 </Untitled>
Note: See TracChangeset
for help on using the changeset viewer.
