Changeset 148 for trunk/lingosource
- Timestamp:
- 02/18/08 05:09:49 (4 years ago)
- Location:
- trunk/lingosource
- Files:
-
- 6 edited
-
castlib1/OSCmenu_Utilities.ls (modified) (2 diffs)
-
castlib1/alexUtilities.ls (modified) (2 diffs)
-
castlib1/bbedit_Utilities.ls (modified) (17 diffs)
-
castlib1/memberInfo.xml (modified) (21 diffs)
-
castlib1/svn_Utilities.ls (modified) (2 diffs)
-
castlib2/memberInfo.xml (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib1/OSCmenu_Utilities.ls
r142 r148 53 53 pLookUpCommandList.setaprop("Batch compare selected scripts", ["mCompareSelectedScriptmembersBatch me", "bbedit_Utilities"]) 54 54 55 56 end if 55 end if 56 57 58 li.add("External script editor Handlers") 59 subli = [] 60 li.add(subli) 61 62 subli.add("Edit in external editor") 63 pLookUpCommandList.setaprop("Edit in external editor", ["mEdit_text_in_ext_editor me", "bbedit_Utilities"]) 64 65 subli.add("Open in external editor") 66 pLookUpCommandList.setaprop("Open in external editor", ["mOpen_text_with_ext_editor me", "bbedit_Utilities"]) 67 68 subli.add("Refresh members edited in external editor") 69 pLookUpCommandList.setaprop("Refresh members edited in external editor", ["mReImport_text_Opened_In_ext_editor me", "bbedit_Utilities"]) 70 71 subli.add("Open linked script") 72 pLookUpCommandList.setaprop("Open linked script", ["mOpen_Linked_Script_With_ext_editor me", "bbedit_Utilities"]) 73 74 subli.add("Diff selected scripts") 75 pLookUpCommandList.setaprop("Diff selected scripts", ["mLiveCompare_SelectedScript me, convertLineBreaksToUnix", "bbedit_Utilities"]) 76 77 78 57 79 58 80 … … 222 244 223 245 subli.add("") 224 subli.add("Open originalof selected alex-linked-library-script in BBEdit")225 pLookUpCommandList.setaprop("Open originalof selected alex-linked-library-script in BBEdit", ["mBBedit me", "bbedit_Utilities"])246 subli.add("Open counterpart of selected alex-linked-library-script in BBEdit") 247 pLookUpCommandList.setaprop("Open counterpart of selected alex-linked-library-script in BBEdit", ["mBBedit me", "bbedit_Utilities"]) 226 248 227 249 subli.add("Check changes in selected alex-linked-library-scripts") -
trunk/lingosource/castlib1/alexUtilities.ls
r136 r148 2427 2427 2428 2428 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2429 ------------------- subversion support works better with unix linebreaks... 2430 2431 on mConvertLineBreaksToUnix me, st 2432 2433 if mCheckForXtra(me, "Pregex") = 1 then 2434 scrTextLi = [st] 2435 pregex_replace(scrTextLi, "\x0D\x0A?", "g", "\x0A") 2436 return scrTextLi[1] 2437 else 2438 fndStr = numToChar(13) & numToChar(10) 2439 offs = offset(fndStr, st) 2440 repeat while offs > 0 2441 delete char offs of st 2442 offs = offset(fndStr, st) 2443 end repeat 2444 2445 fndStr = numToChar(13) 2446 offs = offset(fndStr, st) 2447 repeat while offs > 0 2448 put numToChar(10) into char offs of st 2449 offs = offset(fndStr, st) 2450 end repeat 2451 2452 end if 2453 2454 return st 2455 2456 end 2457 2458 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2459 ----------- always convert to mac linebreaks for scripts as director internally uses mac linebreaks 2460 2461 on mConvertLineBreaksToMac me, scrText 2462 2463 if mCheckForXtra(me, "Pregex") = 1 then 2464 2465 scrTextLi = [scrText] 2466 pregex_replace(scrTextLi, "\x0D?\x0A", "g", "\x0D") 2467 return scrTextLi[1] 2468 2469 else 2470 2471 -- first convert windows to mac 2472 fndStr = numToChar(13) & numToChar(10) 2473 offs = offset(fndStr, scrText) 2474 repeat while offs > 0 2475 put numToChar(13) into char offs to offs+1 of scrText 2476 offs = offset(fndStr, scrText) 2477 end repeat 2478 2479 -- now convert unix to mac 2480 fndStr = numToChar(10) 2481 offs = offset(fndStr, scrText) 2482 repeat while offs > 0 2483 put numToChar(13) into char offs of scrText 2484 offs = offset(fndStr, scrText) 2485 end repeat 2486 2487 end if 2488 ----------------------------------------- 2489 2490 return scrText 2491 2492 end 2493 2494 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2495 2496 on mGetTempFilePath me, theName 2497 2498 if mCheckForXtra(me, "BudAPI") then 2499 if the platform contains "mac" then 2500 2501 resetUNames = 0 2502 if baSysFolder("prefs") starts "/" then 2503 baReturnUnixNames(0) 2504 resetUNames = 1 2505 end if 2506 tempSrcHFSPath = basysfolder("temp") & theName 2507 if resetUNames = 1 then baReturnUnixNames(1) 2508 return tempSrcHFSPath 2509 2510 else 2511 tmpfolder = baSysFolder("temp") 2512 return tmpfolder & theName 2513 end if 2514 2515 else 2516 if the platform contains "mac" then 2517 2518 tempSrcPath = "/tmp/" & theName 2519 2520 return mConvertUnix2Hfs(me, tempSrcPath) 2521 2522 else 2523 tmpfolder = "C:\WINDOWS\TEMP\" 2524 return tmpfolder & theName 2525 end if 2526 2527 end if 2528 2529 end 2530 2531 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2429 2532 on _______________GLOSSARY_ITEMS me 2430 2533 end … … 2591 2694 2592 2695 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2696 on _______________EXTERNAL_PATHS me 2697 end 2698 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2699 2700 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2701 2702 on mGetExternalScriptEditor me, externalEditors 2703 2704 if mCheckForXtra(me, "budapi") <> 1 then 2705 alert "You need the buddyApi xtra for this operation" 2706 exit 2707 end if 2708 2709 savePrefs = 0 2710 if ilk(externalEditors) <> #proplist then 2711 externalEditors = value(getPref("handlerMenu_externalEditors.txt")) 2712 if ilk(externalEditors) <> #proplist then externalEditors = [:] 2713 savePrefs = 1 2714 end if 2715 2716 if the shiftdown then 2717 externalScripteditor = "" 2718 savePrefs = 1 2719 else 2720 externalScripteditor = string(externalEditors.getaprop(#externalScripteditor)) 2721 if baFileExists(externalScripteditor) <> 1 then externalScripteditor = "" 2722 end if 2723 2724 if length(externalScripteditor) < 1 then 2725 2726 alert "Please select an external script editor." 2727 externalScripteditor = mGetFilePathFromUser(me) 2728 if length(externalScripteditor) < 1 then return "" 2729 2730 end if 2731 2732 if baFileExists(externalScripteditor) <> 1 then 2733 alert "The path to the external script editor seems to have changed. Please try again in order to search the path." 2734 externalScripteditor = "" 2735 end if 2736 2737 externalEditors.setaprop(#externalScripteditor, externalScripteditor) 2738 2739 if savePrefs = 1 then setPref("handlerMenu_externalEditors.txt", string(externalEditors)) 2740 2741 return externalScripteditor 2742 2743 end 2744 2745 2746 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2747 2748 on mGetSVNDiffBinaryPath me, workingCopies 2749 2750 if (mCheckForXtra(me, "budapi") + (mCheckForXtra(me, "Shell") + mCheckForXtra(me, "ff_shell"))) < 2 then 2751 alert "You need the shell xtra and the buddyApi xtra in order to proceed" 2752 return "" 2753 end if 2754 2755 savePrefs = 0 2756 if ilk(workingCopies) <> #proplist then 2757 workingCopies = value(getPref("svn_workingCopies_paths.txt")) 2758 if ilk(workingCopies) <> #proplist then workingCopies = [:] 2759 savePrefs = 1 2760 end if 2761 2762 2763 svnBinary = string(workingCopies.getaprop(#svnDiffBinary)) 2764 2765 2766 if baFileExists(svnBinary) <> 1 then svnBinary = "" 2767 2768 2769 if length(svnBinary) < 1 then 2770 2771 alert "There is not yet an application specified to handle file diffs. Please select the applivcation you want to use, e.g. TortoiseMerge in your Tortoise folder, if you are using Tortoise." 2772 svnBinary = mGetFilePathFromUser(me) 2773 if length(svnBinary) < 1 then return "" 2774 2775 end if 2776 2777 if baFileExists(svnBinary) <> 1 then 2778 alert "The path to the svn diff binary seems to have changed. Please try again in order to search the path." 2779 svnBinary = "" 2780 end if 2781 2782 2783 2784 workingCopies.setaprop(#svnDiffBinary, svnBinary) 2785 2786 if savePrefs = 1 then setPref("svn_workingCopies_paths.txt", string(workingCopies)) 2787 2788 return svnBinary 2789 2790 end 2791 2792 2793 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2593 2794 on _______________HELPER_HANDLER me 2594 2795 end 2595 2796 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2596 2597 2797 2598 2798 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -
trunk/lingosource/castlib1/bbedit_Utilities.ls
r131 r148 6 6 end 7 7 8 8 9 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 9 10 on _______________BBEDIT_SCRIPTS end … … 11 12 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 12 13 13 on mOpen_Linked_Script_With_BBedit me 14 15 if not(the platform contains "mac") then 16 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" 17 exit 18 end if 14 on mOpen_Linked_Script_With_BBedit me, editor 19 15 20 16 if mCheckForXtra(me, "ff_shell") = 0 then … … 28 24 sel = the selection of castlib cl 29 25 30 clistr = "bbedit" 26 editor = string(editor) 27 if length(editor) < 1 then 28 clistr = "bbedit" 29 else 30 clistr = editor 31 end if 31 32 32 33 repeat with sub in sel … … 51 52 52 53 end 54 55 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 56 57 on mOpen_Linked_Script_With_ext_editor me 58 editor = mGetExternalScriptEditor(me) 59 if length(editor) < 1 then exit 60 mOpen_Linked_Script_With_BBedit me, editor 61 end 53 62 54 63 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx … … 132 141 --------------------- 133 142 -- create a temporary file from scripttext: 134 tempSrcPath = "/tmp/" & theName & ".ls" 135 136 -- tempSrcHFSPath = mDoShellCmd(me, "osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath & "\" & QUOTE & " as string" & QUOTE, 1) 137 -- tempSrcHFSPath = tempSrcHFSPath[1] 138 tempSrcHFSPath = mConvertUnix2Hfs(me, tempSrcPath) 143 if mCheckForXtra(me, "BudAPI") then 144 145 resetUNames = 0 146 if baSysFolder("prefs") starts "/" then 147 baReturnUnixNames(0) 148 resetUNames = 1 149 end if 150 tempSrcHFSPath = basysfolder("temp") & theName & ".ls" 151 baReturnUnixNames(1) 152 tempSrcPath = basysfolder("temp") & theName & ".ls" 153 if resetUNames = 0 then 154 baReturnUnixNames(0) 155 end if 156 else 157 tempSrcPath = "/tmp/" & theName & ".ls" 158 tempSrcHFSPath = mConvertUnix2Hfs(me, tempSrcPath) 159 end if 139 160 140 161 … … 144 165 mDoShellCmd(me, "bbedit " & tempSrcPath) 145 166 146 147 167 end if 148 149 -- neuer = new(#field)150 -- neuer.text = theText151 --152 -- oldclipboardNum = new(#field)153 -- oldclipboardNum.pasteClipBoardInto()154 --155 -- copyToClipBoard(neuer)156 --157 -- shell_cmd("pbpaste | bbedit")158 --159 -- if oldclipboardNum.type <> #empty then copyToClipBoard(oldclipboardNum)160 -- oldclipboardNum.erase()161 -- neuer.erase()162 --163 -- exit164 168 165 169 end if … … 172 176 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 173 177 174 on mReImport_text_Opened_In_BBedit me 175 176 if not(the platform contains "mac") then 177 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" 178 exit 178 on mEdit_text_in_ext_editor me 179 mOpen_text_with_ext_editor me, 1 180 end 181 182 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 183 184 on mGetMacBinary me, editor 185 if not(editor starts "/") then 186 editor = mConvertHFS2Unix(me, editor) 187 end if 188 189 if the last char of editor = "/" then delete the last char of editor 190 191 olddelim = the itemdelimiter 192 the itemdelimiter = "/" 193 194 appname = the last item of editor 195 if offset(".app", appname) = length(appname) - 3 then 196 infoplist = editor & "/Contents/Info.plist" 197 exename = mDoShellCmd(me, "grep -A1 -E '<key>CFBundleExecutable<\/key>'" && QUOTE & infoplist & QUOTE & " | grep -vE '<key>CFBundleExecutable</key>' | cut -d\> -f2 | cut -d\< -f1") 198 if the last char of exename = RETURN then delete the last char of exename 199 if the last char of exename = numToChar(10) then delete the last char of exename 200 editor = editor & "/Contents/MacOS/" & exename 201 end if 202 203 the itemDelimiter = olddelim 204 205 return editor 206 end 207 208 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 209 210 on mOpen_text_with_ext_editor me, doLiveEdit 211 212 if mCheckForXtra(me, "ff_shell") = 0 then 213 if mCheckForXtra(me, "Shell") = 0 then 214 mShellXtraMissing me 215 exit 216 end if 179 217 end if 180 218 … … 182 220 sel = the selection of castlib cl 183 221 222 if mCheckForXtra(me, "BudAPI") then 223 -- tempFolder = basysfolder("temp") 224 225 if the platform contains "mac" then 226 227 isMac = 1 228 resetUNames = 0 229 if baSysFolder("prefs") starts "/" then 230 baReturnUnixNames(0) 231 resetUNames = 1 232 end if 233 tempFolderHFS = basysfolder("temp") 234 baReturnUnixNames(1) 235 tempFolder = basysfolder("temp") 236 if resetUNames = 0 then 237 baReturnUnixNames(0) 238 end if 239 240 else 241 tempFolderHFS = basysfolder("temp") 242 tempFolder = tempFolderHFS 243 end if 244 245 246 else 247 alert "You need the buddyApi xtra for this operation" 248 exit 249 end if 250 251 editor = mGetExternalScriptEditor(me) 252 if length(editor) < 1 then exit 253 184 254 repeat with sub in sel 185 255 repeat with mem = sub[1] to sub[2] … … 187 257 memref = member(mem,cl) 188 258 259 theText = "" 260 theType = memref.type 261 if theType = #script then 262 theText = memref.scripttext 263 else if theType = #text then 264 theText = memref.html 265 else if theType = #field then 266 theText = memref.text 267 end if 268 269 if length(theText) > 0 then 270 271 272 if doLiveEdit then 273 --------------------- 274 tempSrcPath = tempFolder & "temp_LingoScript_file.ls" 275 276 if isMac then 277 waitparam = "" 278 editor = mGetMacBinary(me, editor) 279 tempSrcHFSPath = mConvertUnix2Hfs(me, tempSrcPath) 280 else 281 waitparam = " \w" 282 tempSrcHFSPath = tempSrcPath 283 end if 284 --------------------- 285 286 theResult = mSaveTextToTempFile(me, theText, tempSrcHFSPath) 287 288 mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 289 290 theText = mGetTextFromFile(me, tempSrcHFSPath) 291 292 theText = mForceMacLineBreaks(me, theText) 293 294 if theType = #script then 295 memref.scripttext = theText 296 else if theType = #text then 297 memref.html = theText 298 else if theType = #field then 299 memref.text = theText 300 end if 301 302 303 else 304 305 theName = memref.name 306 if length(theName) < 1 then 307 theName = "member_" & memref.membernum & "_" & memref.castlibnum 308 end if 309 --------------------- 310 -- create a temporary file from scripttext: 311 tempSrcPath = tempFolder & theName & ".ls" 312 313 if isMac then 314 waitparam = " &" 315 editor = "" 316 tempSrcHFSPath = tempSrcPath 317 else 318 waitparam = "" 319 tempSrcHFSPath = tempSrcPath 320 end if 321 322 theResult = mSaveTextToTempFile(me, theText, tempSrcHFSPath) 323 --------------------- 324 325 mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 326 327 end if 328 329 end if 330 end repeat 331 end repeat 332 333 end 334 335 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 336 337 on mReImport_text_Opened_In_ext_editor me 338 mReImport_text_Opened_In_BBedit me 339 end 340 341 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 342 343 on mReImport_text_Opened_In_BBedit me 344 345 cl = the activecastlib 346 sel = the selection of castlib cl 347 348 repeat with sub in sel 349 repeat with mem = sub[1] to sub[2] 350 351 memref = member(mem,cl) 189 352 190 353 theName = memref.name … … 193 356 end if 194 357 195 delim = the last char of the moviepath 196 olddelim = the itemdelimiter 197 the itemdelimiter = delim 198 hd = item 1 of getosdirectory() 199 200 tempSrcPath = hd & delim & "tmp" & delim & theName & ".ls" 201 the itemdelimiter = olddelim 358 if not(the platform contains "mac") then 359 if mCheckForXtra(me, "BudAPI") then 360 tempSrcPath = basysfolder("temp") 361 put theName & ".ls" after tempSrcPath 362 else 363 alert "You need the buddyApi xtra for this operation" 364 exit 365 end if 366 else 367 delim = the last char of the moviepath 368 olddelim = the itemdelimiter 369 the itemdelimiter = delim 370 hd = item 1 of getosdirectory() 371 372 tempSrcPath = hd & delim & "tmp" & delim & theName & ".ls" 373 the itemdelimiter = olddelim 374 end if 202 375 203 376 theText = mGetTextFromFile(me, tempSrcPath) 204 377 205 378 if length(theText) > 0 then 379 380 theText = mForceMacLineBreaks(me, theText) 206 381 207 382 case memref.type of … … 216 391 end repeat 217 392 393 end 394 395 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 396 397 on mForceMacLineBreaks me, theText 398 rettext = "" 399 olddelim = the itemdelimiter 400 the itemdelimiter = numToChar(10) 401 thirteen = numToChar(13) 402 num = the number of items of theText 403 repeat with n = num down to 1 404 i = item n of theText 405 put i after rettext 406 if the last char of i <> thirteen then put thirteen after rettext 407 end repeat 408 the itemdelimiter = olddelim 409 return rettext 218 410 end 219 411 … … 544 736 end if 545 737 end 738 739 740 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 741 742 on mLiveCompare_SelectedScript me, convertLineBreaksToUnix 743 744 cl = the activecastlib 745 sel = the selection of castlib cl 746 747 if count(sel) > 0 then 748 memref1 = member(sel[1][1], cl) 749 if sel[1][2] <> sel[1][1] then 750 memref2 = member(sel[1][2], cl) 751 else 752 if count(sel) < 2 then 753 alert "Please select two castmembers!" 754 exit 755 end if 756 memref2 = member(sel[2][1], cl) 757 end if 758 else 759 alert "Please select two castmembers!" 760 exit 761 end if 762 763 memtype = memref1.type 764 if [#script, #field, #text].getPos(memtype) < 1 then 765 alert "The members must be either #script, #field or #text members!" 766 exit 767 else 768 case memtype of 769 770 ----------------------- 771 #script: 772 ext1 = ".ls" 773 st1 = memref1.scripttext 774 775 ----------------------- 776 #text: 777 ext1 = ".html" 778 st1 = memref1.html 779 780 ----------------------- 781 otherwise: 782 ext1 = ".txt" 783 st1 = memref1.text 784 785 end case 786 787 end if 788 789 memtype = memref2.type 790 if [#script, #field, #text].getPos(memtype) < 1 then 791 alert "The members must be either #script, #field or #text members!" 792 exit 793 else 794 case memtype of 795 796 ----------------------- 797 #script: 798 ext2 = ".ls" 799 st2 = memref2.scripttext 800 801 ----------------------- 802 #text: 803 ext2 = ".html" 804 st2 = memref2.html 805 806 ----------------------- 807 otherwise: 808 ext2 = ".txt" 809 st2 = memref2.text 810 811 end case 812 end if 813 814 if not(the platform contains "mac") then 815 816 bbdiffpath = mGetSVNDiffBinaryPath(me) 817 818 if length(bbdiffpath) < 1 then exit 819 820 isMac = 0 821 else 822 isMac = 1 823 bbdiffpath = mFindUnixAppInPath(me, "bbdiff") 824 if length(bbdiffpath) < 1 then 825 alert "This function only works with BBDiff, a command line tool provided by BBEdit. Consider installing BBEdits command line tools, it is really helpful." 826 exit 827 end if 828 829 end if 830 831 832 if mCheckForXtra(me, "ff_shell") = 0 then 833 if mCheckForXtra(me, "Shell") = 0 then 834 mShellXtraMissing me 835 exit 836 end if 837 end if 838 839 840 name1 = memref1.name & "_m" & memref1.memberNum & "_c" & memref1.castlibnum 841 fname1 = mGetTempFilePath(me, name1 & ext1) 842 843 name2 = memref2.name & "_m" & memref2.memberNum & "_c" & memref2.castlibnum 844 fname2 = mGetTempFilePath(me, name2 & ext2) 845 846 ------------------------------------------ trac subversion support works better with unix linebreaks... 847 if voidP(convertLineBreaksToUnix) then convertLineBreaksToUnix = 1 848 if convertLineBreaksToUnix = "" then convertLineBreaksToUnix = 1 849 850 if convertLineBreaksToUnix = 1 then 851 st1 = mConvertLineBreaksToUnix(me, st1) 852 st2 = mConvertLineBreaksToUnix(me, st2) 853 end if 854 ----------------------------------------- 855 856 857 theResult = mSaveTextToTempFile(me, st1, fname1) 858 theResult = mSaveTextToTempFile(me, st2, fname2) 859 --------------------- 860 861 862 if isMac then 863 864 865 theResult = mDoShellCmd(me, bbdiffpath & " --ignore-curly-quotes --ignore-spaces --wait --resume " "E& mConvertHFS2Unix(me, fname1) "E&"E& mConvertHFS2Unix(me, fname2) "E && "2>&1", RETURN, 0, 1) 866 867 -- since we used the --wait and the --resume switch, we will only come to this line AFTER the diff process in bbedit is finished 868 869 if count(theResult) > 0 then 870 if theResult[1] contains "no such file or directory" then 871 put theResult[1] 872 else 873 put "No differences found for member: " & memref1.name && "(" & memref1 & ") and " & memref2.name && "(" & memref2 & ")" 874 end if 875 writeBack = 0 876 877 else 878 879 -------- now write the results of the BBEdit diff back into the script members 880 st1 = mGetTextFromFile(me, fname1) 881 st2 = mGetTextFromFile(me, fname2) 882 883 writeBack = 1 884 885 end if 886 887 ---------------------- windows 888 else 889 890 891 theResult = mDoShellCmd(me, QUOTE & bbdiffpath & QUOTE && QUOTE & fname1 "E&"E& fname2 "E, RETURN, 0, 0, 0) 892 893 -------- now write the results of the BBEdit diff back into the script members 894 st1 = mGetTextFromFile(me, fname1) 895 st2 = mGetTextFromFile(me, fname2) 896 897 writeBack = 1 898 end if 899 900 901 if writeBack = 1 then 902 903 904 if convertLineBreaksToUnix = 1 then 905 st1 = mConvertLineBreaksToMac(me, st1) 906 st2 = mConvertLineBreaksToMac(me, st2) 907 end if 908 909 memtype = memref1.type 910 case memtype of 911 ----------------------- 912 #script: 913 memref1.scripttext = st1 914 915 ----------------------- 916 #text: 917 memref1.html = st1 918 919 ----------------------- 920 otherwise: 921 memref1.text = st1 922 923 end case 924 925 memtype = memref2.type 926 case memtype of 927 ----------------------- 928 #script: 929 memref2.scripttext = st2 930 931 ----------------------- 932 #text: 933 memref2.html = st2 934 935 ----------------------- 936 otherwise: 937 memref2.text = st2 938 939 end case 940 941 end if 942 943 944 end 945 546 946 547 947 … … 891 1291 892 1292 893 -- if not(the platform contains "mac") then894 -- 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"895 -- exit896 -- end if897 --898 -- if mCheckForXtra(me, "Shell") = 0 then899 -- mShellXtraMissing me900 -- exit901 -- end if902 903 904 1293 bbdiffpath = "" 905 1294 if the platform contains "mac" then … … 925 1314 926 1315 927 928 929 930 1316 cl = the activecastlib 931 1317 sel = the selection of castlib cl … … 946 1332 memname = memref.name 947 1333 comm = memref.comments 948 if comm.length then 1334 1335 if length(comm) < 1 then 1336 -- put memref.name && "(" & memref & ") has no comments - not linked" 1337 else 949 1338 950 1339 aPath = mGetFilePathFromMemberComments(me, memref, isMac, CurrentOSXUserName) 951 1340 952 if length(aPath) > 0 then 1341 if length(aPath) < 1 then 1342 -- put memref.name && "(" & memref & ") has no comments - not linked" 1343 else 953 1344 954 1345 fio = (xtra "fileio").new() 1346 955 1347 if objectP(fio) then 1348 956 1349 fio.openFile(aPath, 0) 957 if fio.status() = 0 then 1350 1351 if fio.status() <> 0 then 1352 put memref.name && "(" & memref & "): Couldn't open file:" && aPath && "fileIO error:" && fio.error(fio.status()) 1353 else 1354 958 1355 vergText = fio.readFile() 959 1356 fio.closeFile() 960 1357 memscr = memref.scripttext 961 if vergText <> memscr then 1358 1359 if vergText = memscr then 1360 put memref.name && "(" & memref & ") has no changes" 1361 else 962 1362 963 1363 isEqual = 0 … … 975 1375 end if 976 1376 977 if isEqual = 0 then 1377 if isEqual <> 0 then 1378 put memref.name && "(" & memref & ") has no changes" 1379 else 978 1380 979 1381 if length(bbdiffpath) < 1 then … … 1009 1411 else 1010 1412 1011 1012 -- tempSrcPath = mDoShellCmd(me, "mktemp -t temp_BBDiff_file1.ls", 1)1013 -- tempSrcPath = tempSrcPath[1]1014 1413 tempSrcPath = "/tmp/temp_BBEdit_file.ls" 1015 1016 -- tempSrcHFSPath = mDoShellCmd(me, "osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath & "\" & QUOTE & " as string" & QUOTE, 1)1017 -- tempSrcHFSPath = tempSrcHFSPath[1]1018 1414 tempSrcHFSPath = mConvertUnix2Hfs(me, tempSrcPath) 1019 1415 1020 1416 mSaveTextToTempFile(me, memref.scripttext, tempSrcHFSPath) 1021 1022 -- comm = memref.comments1023 -- if comm.length then1024 -- if char 1 of comm = "~" then1025 -- put shell_Cmd("echo -n $HOME") into char 1 of comm1026 -- end if1027 -- end if1028 1029 1417 1030 1418 if char 1 of comm = "~" then put "$HOME" into char 1 of comm -
trunk/lingosource/castlib1/memberInfo.xml
r136 r148 5 5 <comments></comments> 6 6 <memberName>doCommandMovieScript</memberName> 7 <f name>doCommandMovieScript</fname>7 <fName>doCommandMovieScript</fName> 8 8 </doCommandMovieScript> 9 9 <thisMoviesScript> … … 11 11 <comments></comments> 12 12 <memberName>thisMoviesScript</memberName> 13 <f name>thisMoviesScript</fname>13 <fName>thisMoviesScript</fName> 14 14 </thisMoviesScript> 15 15 <keyboardNavigation_FrameLoop> … … 17 17 <comments></comments> 18 18 <memberName>keyboardNavigation_FrameLoop</memberName> 19 <f name>keyboardNavigation_FrameLoop</fname>19 <fName>keyboardNavigation_FrameLoop</fName> 20 20 </keyboardNavigation_FrameLoop> 21 21 <menu1_button> … … 23 23 <comments></comments> 24 24 <memberName>menu1_button</memberName> 25 <f name>menu1_button</fname>25 <fName>menu1_button</fName> 26 26 </menu1_button> 27 27 <menu2_button> … … 29 29 <comments></comments> 30 30 <memberName>menu2_button</memberName> 31 <f name>menu2_button</fname>31 <fName>menu2_button</fName> 32 32 </menu2_button> 33 33 <simpleBMMenu> … … 35 35 <comments></comments> 36 36 <memberName>simpleBMMenu</memberName> 37 <f name>simpleBMMenu</fname>37 <fName>simpleBMMenu</fName> 38 38 </simpleBMMenu> 39 39 <OSCmenu_Utilities> … … 41 41 <comments></comments> 42 42 <memberName>OSCmenu_Utilities</memberName> 43 <f name>OSCmenu_Utilities</fname>43 <fName>OSCmenu_Utilities</fName> 44 44 </OSCmenu_Utilities> 45 45 <alexUtilities> … … 47 47 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 48 48 <memberName>alexUtilities</memberName> 49 <f name>alexUtilities</fname>49 <fName>alexUtilities</fName> 50 50 </alexUtilities> 51 51 <convert_Lingo_2_CSS_Html> … … 53 53 <comments>~/Documents/Scripts/lingo/convert_Lingo_2_CSS_Html.ls</comments> 54 54 <memberName>convert_Lingo_2_CSS_Html</memberName> 55 <f name>convert_Lingo_2_CSS_Html</fname>55 <fName>convert_Lingo_2_CSS_Html</fName> 56 56 </convert_Lingo_2_CSS_Html> 57 57 <OSCmenu_Handlers> … … 59 59 <comments></comments> 60 60 <memberName>OSCmenu_Handlers</memberName> 61 <f name>OSCmenu_Handlers</fname>61 <fName>OSCmenu_Handlers</fName> 62 62 </OSCmenu_Handlers> 63 63 <pastefeld> … … 65 65 <comments></comments> 66 66 <memberName>pastefeld</memberName> 67 <f name>pastefeld</fname>67 <fName>pastefeld</fName> 68 68 </pastefeld> 69 69 <oldclipboard> … … 71 71 <comments></comments> 72 72 <memberName>oldclipboard</memberName> 73 <f name>oldclipboard</fname>73 <fName>oldclipboard</fName> 74 74 </oldclipboard> 75 75 <searchword> … … 77 77 <comments></comments> 78 78 <memberName>searchword</memberName> 79 <f name>searchword</fname>79 <fName>searchword</fName> 80 80 </searchword> 81 81 <resizewindowfs> … … 83 83 <comments></comments> 84 84 <memberName>resizewindowfs</memberName> 85 <f name>resizewindowfs</fname>85 <fName>resizewindowfs</fName> 86 86 </resizewindowfs> 87 87 <showHideHelp> … … 89 89 <comments></comments> 90 90 <memberName>showHideHelp</memberName> 91 <f name>showHideHelp</fname>91 <fName>showHideHelp</fName> 92 92 </showHideHelp> 93 93 <helptext> … … 98 98 rtf</comments> 99 99 <memberName>helptext</memberName> 100 <f name>helptext</fname>100 <fName>helptext</fName> 101 101 </helptext> 102 102 <texthyperlinkBehavior> … … 104 104 <comments>/Users/alex/Documents/ALIEN/myLinkedScripts/texthyperlinkBehavior.ls</comments> 105 105 <memberName>texthyperlinkBehavior</memberName> 106 <f name>texthyperlinkBehavior</fname>106 <fName>texthyperlinkBehavior</fName> 107 107 </texthyperlinkBehavior> 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 117 <bbedit_Utilities> … … 119 119 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 120 120 <memberName>bbedit_Utilities</memberName> 121 <f name>bbedit_Utilities</fname>121 <fName>bbedit_Utilities</fName> 122 122 </bbedit_Utilities> 123 123 <svn_Utilities> … … 125 125 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 126 126 <memberName>svn_Utilities</memberName> 127 <f name>svn_Utilities</fname>127 <fName>svn_Utilities</fName> 128 128 </svn_Utilities> 129 129 <custom_Utilities> … … 131 131 <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 132 132 <memberName>custom_Utilities</memberName> 133 <f name>custom_Utilities</fname>133 <fName>custom_Utilities</fName> 134 134 </custom_Utilities> 135 135 </Untitled> -
trunk/lingosource/castlib1/svn_Utilities.ls
r146 r148 2985 2985 end 2986 2986 2987 2987 2988 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2988 2989 2989 on mGet SVNDiffBinaryPath me, workingCopies2990 2991 if (mCheckForXtra(me, "budapi") + (mCheckForXtra(me, "Shell") + mCheckForXtra(me, "ff_shell"))) < 2 then2992 alert "You need the shell xtra and the buddyApi xtra in order to proceed"2993 return ""2990 on mGetWorkingCopyPath me, movieIdentifier, chooseNewPath, workingCopies, selectMsg 2991 2992 movieIdentifier = string(movieIdentifier) 2993 if length(movieIdentifier) < 1 then 2994 movieIdentifier = the moviepath & the moviename 2994 2995 end if 2995 2996 … … 3001 3002 end if 3002 3003 3003 3004 svnBinary = string(workingCopies.getaprop(#svnDiffBinary))3005 3006 3007 if baFileExists(svnBinary) <> 1 then svnBinary = ""3008 3009 3010 if length(svnBinary) < 1 then3011 3012 alert "There is not yet an application specified to handle file diffs. Please select the applivcation you want to use, e.g. TortoiseMerge in your Tortoise folder, if you are using Tortoise."3013 svnBinary = mGetFilePathFromUser(me)3014 if length(svnBinary) < 1 then return ""3015 3016 end if3017 3018 if baFileExists(svnBinary) <> 1 then3019 alert "The path to the svn diff binary seems to have changed. Please try again in order to search the path."3020 svnBinary = ""3021 end if3022 3023 3024 3025 workingCopies.setaprop(#svnDiffBinary, svnBinary)3026 3027 if savePrefs = 1 then setPref("svn_workingCopies_paths.txt", string(workingCopies))3028 3029 return svnBinary3030 3031 end3032 3033 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3034 3035 on mGetWorkingCopyPath me, movieIdentifier, chooseNewPath, workingCopies, selectMsg3036 3037 movieIdentifier = string(movieIdentifier)3038 if length(movieIdentifier) < 1 then3039 movieIdentifier = the moviepath & the moviename3040 end if3041 3042 savePrefs = 03043 if ilk(workingCopies) <> #proplist then3044 workingCopies = value(getPref("svn_workingCopies_paths.txt"))3045 if ilk(workingCopies) <> #proplist then workingCopies = [:]3046 savePrefs = 13047 end if3048 3049 3004 workingFolder = string(workingCopies.getaprop(movieIdentifier)) 3050 3005 -
trunk/lingosource/castlib2/memberInfo.xml
r136 r148 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.
