Farbflash projects: Imaging lingo table | 3-D scene list | Find all | Handler menu | Lingo message window

Changeset 74 for trunk/lingosource


Ignore:
Timestamp:
12/06/07 23:17:27 (4 years ago)
Author:
alex
Message:

consolidate beta branch to trunk try 1

Location:
trunk/lingosource
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib1/OSCmenu_Utilities.ls

    r63 r74  
    2222   
    2323  subli.add("Insert current date") 
    24   pLookUpCommandList.setaprop("Insert current date", "pasteDate me") 
     24  pLookUpCommandList.setaprop("Insert current date", ["pasteDate me", "alexUtilities"]) 
    2525   
    2626  subli.add("Insert divider") 
    27   pLookUpCommandList.setaprop("Insert divider", "pasteDivider me") 
     27  pLookUpCommandList.setaprop("Insert divider", ["pasteDivider me", "alexUtilities"]) 
    2828   
    2929  li.add("") 
     
    3636     
    3737    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"]) 
    3939     
    4040    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"]) 
    4242     
    4343    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"]) 
    4545     
    4646    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"]) 
    4848     
    4949  end if 
     
    5656   
    5757  subli.add("Choose file...") 
    58   pLookUpCommandList.setaprop("Choose file...", "mGetFilePathFromUser me") 
     58  pLookUpCommandList.setaprop("Choose file...", ["mGetFilePathFromUser me", "alexUtilities"]) 
    5959   
    6060  subli.add("Choose folder...") 
    61   pLookUpCommandList.setaprop("Choose folder...", "mGetFolderPathFromUser me") 
     61  pLookUpCommandList.setaprop("Choose folder...", ["mGetFolderPathFromUser me", "alexUtilities"]) 
    6262   
    6363  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"]) 
    6565   
    6666  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"]) 
    6868   
    6969  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"]) 
    7171   
    7272   
     
    7777   
    7878  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"]) 
    8080   
    8181  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"]) 
    8383   
    8484   
     
    8989   
    9090  subli.add("Convert to bitmap") 
    91   pLookUpCommandList.setaprop("Convert to bitmap", "mConvertToBitmap me") 
     91  pLookUpCommandList.setaprop("Convert to bitmap", ["mConvertToBitmap me", "alexUtilities"]) 
    9292   
    9393   
     
    9898   
    9999  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"]) 
    101101   
    102102  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"]) 
    104104   
    105105  li.add("") 
     
    112112   
    113113  subli.add("Unlink bitmap members") 
    114   pLookUpCommandList.setaprop("Unlink bitmap members", "mUnlinkBitmaps me") 
     114  pLookUpCommandList.setaprop("Unlink bitmap members", ["mUnlinkBitmaps me", "alexUtilities"]) 
    115115   
    116116  subli.add("") 
    117117  subli.add("Link selected text...") 
    118   pLookUpCommandList.setaprop("Link selected text...", "mLinkSelectedText me") 
     118  pLookUpCommandList.setaprop("Link selected text...", ["mLinkSelectedText me", "alexUtilities"]) 
    119119   
    120120  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"]) 
    122122   
    123123   
     
    128128   
    129129  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"]) 
    131131   
    132132  subli.add("") 
    133133  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"]) 
    135135   
    136136  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"]) 
    138138   
    139139   
     
    145145   
    146146  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"]) 
    148148   
    149149  subli.add("") 
    150150  subli.add("Name Members...") 
    151   pLookUpCommandList.setaprop("Name Members...", "mNameMemberNames me, newName") 
     151  pLookUpCommandList.setaprop("Name Members...", ["mNameMemberNames me, newName", "alexUtilities"]) 
    152152   
    153153  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"]) 
    155155   
    156156  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"]) 
    158158   
    159159  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"]) 
    161161   
    162162  subli.add("") 
    163163  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"]) 
    165165   
    166166  subli.add("Erase dummy members") 
    167   pLookUpCommandList.setaprop("Erase dummy members", "mRemoveDummyMember me") 
     167  pLookUpCommandList.setaprop("Erase dummy members", ["mRemoveDummyMember me", "alexUtilities"]) 
    168168   
    169169   
     
    177177   
    178178  subli.add("Put script stats") 
    179   pLookUpCommandList.setaprop("Put script stats", "GetScriptlines me") 
     179  pLookUpCommandList.setaprop("Put script stats", ["GetScriptlines me", "alexUtilities"]) 
    180180   
    181181  subli.add("Find all Puts") 
    182   pLookUpCommandList.setaprop("Find all Puts", "mListallPuts me") 
     182  pLookUpCommandList.setaprop("Find all Puts", ["mListallPuts me", "alexUtilities"]) 
    183183   
    184184   
     
    189189   
    190190  subli.add("Lingo help...") 
    191   pLookUpCommandList.setaprop("Lingo help...", "mGetHelp me, theText") 
     191  pLookUpCommandList.setaprop("Lingo help...", ["mGetHelp me, theText", "alexUtilities"]) 
    192192   
    193193  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"]) 
    195195   
    196196  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"]) 
    198198   
    199199   
     
    205205    subli = [] 
    206206    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     
    210216    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     
    213223    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     
    215227    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"]) 
    217230     
    218231     
     
    223236    li.add(subli) 
    224237    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"]) 
    226239     
    227240    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"]) 
    229242     
    230243     
     
    241254  svn_subli.add(subli) 
    242255  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"]) 
    244257   
    245258  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"]) 
    247260   
    248261  subli.add("") 
    249262  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"]) 
    251264   
    252265  subli.add("") 
    253266  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"]) 
    255268   
    256269   
    257270  subli.add("") 
    258271  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"]) 
    260273   
    261274  subli.add("") 
    262275  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"]) 
    264277   
    265278   
     
    273286   
    274287  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"]) 
    276289   
    277290  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"]) 
    279292   
    280293  subli.add("") 
    281294  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"]) 
    283296   
    284297   
     
    292305   
    293306  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"]) 
    295308   
    296309  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"]) 
    298311   
    299312  subli.add("") 
    300313  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"]) 
    302315   
    303316  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"]) 
    305318   
    306319  ---------------------------------------------------- 
     
    312325   
    313326  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"]) 
    315328   
    316329  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"]) 
    318331   
    319332  ---------------------------------------------------- 
     
    327340   
    328341  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"]) 
    330343   
    331344   
    332345  --------------------------------------------------- 
    333346  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"]) 
    335348   
    336349   
     
    343356   
    344357  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"]) 
    346359   
    347360   
     
    352365  else fnd = "Explorer" 
    353366  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"]) 
    355368   
    356369   
     
    406419     
    407420    -- 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 
    410429     
    411430     
     
    421440    else 
    422441       
    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 
    425447       
    426448      glob = xscr().mGetGlobalList() 
     
    428450      olddelim = the itemdelimiter 
    429451      the itemdelimiter = "," 
    430       delete item 1 of cmdli 
     452      delete item 1 of cmdStr 
    431453      the itemdelimiter = olddelim 
    432454       
     
    436458      glob[#copy2ClipBoard] = 0 
    437459       
    438       alexUtilities = new(script "alexUtilities") 
    439       alexUtilities.setaprop(#pHandlerMenuWindowName, (the activewindow).name) 
    440       glob[#theTargetInstance] = alexUtilities 
    441        
    442       if cmdli.word.count then 
    443         mShowMui cmdli 
     460      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 
    444466      else 
    445467        mDoCmd 
  • trunk/lingosource/castlib1/alexUtilities.ls

    r63 r74  
    159159    if (voidP(pfad) or (pfad = "")) then 
    160160      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         
    161168        startfolder = string(startfolder) 
    162169        if length(startfolder) > 0 then 
     
    165172          pfad = baGetFilename("save", "", theDefaultName, "", 524288+4+2+4194304, theTitle, false, -1, -1) 
    166173        end if 
     174         
     175        if resetUNames = 1 then baReturnUnixNames(1) 
     176         
    167177      else 
    168178        pfad = fio.displaySave(theTitle, theDefaultName) 
     
    315325  theTitle = "Save text" 
    316326  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     
    317334    pfad = baGetFilename("save", "", theDefaultName, "", 524288+4+2+4194304, theTitle, false, -1, -1) 
     335     
     336    if resetUNames = 1 then baReturnUnixNames(1) 
     337     
    318338  else 
    319339    fio = new(xtra "fileio") 
     
    376396   
    377397  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     
    378405    retval = baGetFolder( "", "Select a folder", 3, "", 50, 50 ) 
     406     
     407    if resetUNames = 1 then baReturnUnixNames(1) 
     408     
    379409  else if mCheckForXtra(me, "FileXtra4") = 1 then -- if not buddy then try filextra 
    380410    fx = (xtra "filextra4").new() 
     
    409439   
    410440  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     
    411453    --  -- budApi version: 
    412     retval = baFileList(folderpath, "*.*") 
     454    -- retval = baFileList(folderpath, "*.*") 
    413455     
    414456  else if mCheckForXtra(me, "FileXtra4") = 1 then -- if not buddy then try filextra 
     
    21532195 
    21542196 
    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 
     2199on _______________SHELL_COMMAND me 
     2200end 
     2201-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     2202 
     2203 
     2204on 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 
    22902217  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 
    24252233    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 " &QUOTE& tempSrcPath &QUOTE&&QUOTE& comm &QUOTE) 
    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("&QUOTE&"PBPaste | BBedit ; BBedit "&memref.comments&QUOTE&")"&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("&QUOTE&"PBPaste | BBedit ; BBedit "&memref.comments&QUOTE&")"&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 " &QUOTE& tempSrcPath &QUOTE&&QUOTE& comm &QUOTE) 
    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 " &QUOTE& tempSrcPath &QUOTE&&QUOTE& comm &QUOTE && "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 
    34932247  return "" 
    34942248   
     
    34972251 
    34982252-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    3499 -- this can be used to open the corresponding script in bbedit and svn compare it to head 
    3500  
    3501 on mExportCurrentScriptToWorkingCopyAndOpen me, convertLineBreaksToUnix 
    3502    
    3503   mExportScriptsToFolder me, 1, 1, convertLineBreaksToUnix 
    3504    
    3505   cl = the activecastlib 
    3506   sel = the selection of castlib cl 
    3507    
    3508   repeat with sub in sel 
    3509     repeat with mem = sub[1] to sub[2] 
    3510       memref = member(mem,cl)    
    3511       memtype = memref.type 
    3512       if [#script, #field, #text].getPos(memtype) > 0 then 
    3513          
    3514         case memtype of 
    3515              
    3516             ----------------------- 
    3517           #script: 
    3518             ext = ".ls" 
    3519             st = memref.scripttext 
    3520              
    3521             ----------------------- 
    3522           #field: 
    3523             ext = ".txt" 
    3524             st = memref.text 
    3525              
    3526             ----------------------- 
    3527           #text: 
    3528             ext = ".html" 
    3529             st = memref.html 
    3530              
    3531             ----------------------- 
    3532           otherwise: 
    3533             ext = ".txt" 
    3534             st = memref.text 
    3535              
    3536         end case 
    3537          
    3538          
    3539         thePath = mFindWorkingCopyCounterpart(me, memref, ext) 
    3540          
    3541         if length(thePath) < 1 then 
    3542           alert "Corresponding member was not found" 
    3543           exit   
    3544         end if 
    3545          
    3546         ------------------- export will now be done in "mExportScriptsToFolder" 
    3547         --        st = memref.scripttext 
    3548         --        mSaveToTextFile me, st, thePath 
    3549          
    3550         if the platform contains "mac" then 
    3551           if (mCheckForXtra(me, "budapi") + mCheckForXtra(me, "shell")) = 2 then 
    3552              
    3553             bbeditBinary = mFindUnixAppInPath(me, "bbedit") 
    3554             if length(bbeditBinary) > 0 then 
    3555               shell_cmd(bbeditBinary && QUOTE & baUnixName(thePath) & QUOTE) 
    3556               exit 
    3557             end if 
    3558              
    3559           end if 
    3560         end if 
    3561          
    3562         open thePath 
    3563         exit 
    3564          
    3565       end if 
    3566        
    3567     end repeat 
    3568   end repeat 
    3569    
    3570 end 
    3571  
    3572 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    3573  
    3574 on mFindWorkingCopyCounterpart me, memref, file_extension 
    3575    
    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:" && theFolder 
    3584    
    3585   if length(theFolder) < 1 then return "" 
    3586    
    3587    
    3588   m = memref.castlibnum 
    3589    
    3590   delim = the last char of the applicationpath 
    3591   olddelim = the itemdelimiter 
    3592   the itemdelimiter = delim 
    3593   theFoldername = theFolder 
    3594   if the last char of theFoldername = delim then delete the last char of theFoldername 
    3595   else put delim after theFolder 
    3596   theFoldername = the last item of theFoldername 
    3597   the itemdelimiter = olddelim 
    3598    
    3599   infolist = 0 
    3600    
    3601   if theFoldername <> "castlib" & m then 
    3602      
    3603     newPath = theFolder & "castlib" & m & delim 
    3604      
    3605     if baFolderExists(newPath) = 0 then 
    3606        
    3607       infolistPath = theFolder & "memberInfo.xml" 
    3608        
    3609       infolist = mReadXML_2_List(me, infolistPath) 
    3610        
    3611       if ilk(infolist) <> #proplist then 
    3612          
    3613         alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    3614         return "" 
    3615          
    3616       else 
    3617          
    3618         if count(infolist) < 1 then 
    3619            
    3620           alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    3621           return "" 
    3622            
    3623         else 
    3624           theFolder = newPath 
    3625         end if 
    3626          
    3627       end if 
    3628        
    3629     else 
    3630        
    3631       theFolder = newPath 
    3632        
    3633     end if 
    3634      
    3635   end if 
    3636    
    3637    
    3638   if infolist = 0 then 
    3639      
    3640     infolistPath = theFolder & "memberInfo.xml" 
    3641     infolist = mReadXML_2_List(me, infolistPath) 
    3642      
    3643     if ilk(infolist) <> #proplist then 
    3644        
    3645       alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    3646       return "" 
    3647        
    3648     end if 
    3649      
    3650   end if 
    3651    
    3652    
    3653   cnt = count(infolist) 
    3654    
    3655   repeat with l = 1 to cnt 
    3656     li = infolist[l] 
    3657     --    put "memberName:" && li.getaprop(#memberName) 
    3658     if li.getaprop(#memberName) = memref.name then 
    3659        
    3660       fname = string(infolist[l].getaprop(#fname)) 
    3661       if length(fname) < 1 then fname = string(infolist.getpropat(l)) 
    3662       fpath = theFolder & fname & file_extension 
    3663        
    3664       --      put "path:" && fpath  
    3665       if length(baShortFilename(fpath)) > 0 then return fpath 
    3666        
    3667       -- if baFileExists(fpath) then return fpath 
    3668        
    3669     end if 
    3670   end repeat 
    3671    
    3672    
    3673   return "" 
    3674    
    3675 end 
    3676  
    3677 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    3678 -- 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, chooseNewPath 
    3681    
    3682   mExportAllScriptsToDiskWithFolder me, skipIcons, selectionOnly, convertLineBreaksToUnix, void, chooseNewPath 
    3683    
    3684 end 
    3685  
    3686 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    3687  
    3688 on mExportAllScriptsToDiskWithFolder me, skipIcons, selectionOnly, convertLineBreaksToUnix, theFolder, chooseNewPath 
    3689    
    3690   theFolder = string(theFolder) 
    3691   if length(theFolder) < 1 then 
    3692      
    3693     if chooseNewPath <> 1 then 
    3694       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 if 
    3699      
    3700     if length(theFolder) < 1 then 
    3701        
    3702       theFolder = mGetFolderPathFromUser(me) 
    3703        
    3704     end if 
    3705      
    3706   end if 
    3707    
    3708   if length(theFolder) < 1 then exit 
    3709    
    3710   if ilk(selectionOnly) = #castlib then 
    3711     firstCastNum = selectionOnly.number 
    3712     lastCastNum = firstCastNum 
    3713     selectionOnly = 0 
    3714      
    3715   else 
    3716     if selectionOnly = 1 then 
    3717       cl = the activecastlib 
    3718       sel = the selection of castlib cl 
    3719        
    3720       firstCastNum = cl 
    3721       lastCastNum = cl     
    3722        
    3723     else 
    3724       firstCastNum = 1 
    3725       lastCastNum = the number of castlibs 
    3726     end if 
    3727   end if 
    3728    
    3729    
    3730   DirectImageInstance = 0 
    3731   if skipIcons <> 1 then 
    3732     if mCheckForXtra(me, "DirectImage") = 1 then 
    3733       if the platform contains "mac" then 
    3734         DirectImageInstance = new(xtra "DirectImage", 234521832) 
    3735       else 
    3736         DirectImageInstance = new(xtra "DirectImage", 228285877) 
    3737       end if 
    3738     else if mCheckForXtra(me, "SharpExport") = 1 then 
    3739       SharpExportInst = new(xtra "SharpExport") 
    3740     else 
    3741       skipIcons = 1 
    3742     end if 
    3743   end if 
    3744    
    3745    
    3746    
    3747    
    3748   isMac = (the platform contains "mac") -- we need the differentiation because of the dreaded 31 char limit 
    3749    
    3750   doit = 0 
    3751    
    3752    
    3753   statusSwitched = mSwitchToStatusMode(me, 1) 
    3754    
    3755   repeat with m = firstCastNum to lastCastNum 
    3756      
    3757     thisFolder = theFolder & "castlib" & m 
    3758     if baFolderExists(thisFolder) <> 1 then 
    3759       err = baCreateFolder(thisFolder) 
    3760       if err <> 1 then 
    3761         alert "Failed to create directory:" && thisFolder 
    3762         if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    3763         DirectImageInstance = 0 
    3764         exit 
    3765       end if 
    3766     end if 
    3767      
    3768     thisFolder = thisFolder & the last char of the applicationpath 
    3769      
    3770      
    3771     doit = 0 
    3772     infolistPath = thisFolder & "memberInfo.xml" 
    3773     infolist = mReadXML_2_List(me, infolistPath) 
    3774     if ilk(infolist) <> #proplist then infolist = [:] 
    3775      
    3776      
    3777     if selectionOnly = 1 then 
    3778       sel = the selection of castlib m 
    3779     else 
    3780       cnt = the number of members of castlib m 
    3781       sel = [[1, cnt]] 
    3782     end if 
    3783      
    3784     repeat with sub in sel 
    3785       repeat with n = sub[1] to sub[2]    
    3786          
    3787         memref = member(n, m) 
    3788          
    3789         memtype = memref.type 
    3790          
    3791         -- if [#script].getPos(memtype) > 0 then 
    3792         if [#script, #field, #text].getPos(memtype) > 0 then 
    3793            
    3794           case memtype of 
    3795                
    3796               ----------------------- 
    3797             #script: 
    3798               ext = ".ls" 
    3799               scrText = memref.scripttext 
    3800               scrtype = memref.scripttype 
    3801               ----------------------- 
    3802             #field: 
    3803               ext = ".txt" 
    3804               scrText = memref.text 
    3805               scrtype = #field 
    3806               ----------------------- 
    3807             #text: 
    3808               ext = ".html" 
    3809               scrText = memref.html 
    3810               convertLineBreaksToUnix = 0 
    3811               scrtype = #text 
    3812               ----------------------- 
    3813             otherwise: 
    3814               ext = ".txt" 
    3815               scrText = memref.text 
    3816               scrtype = #field 
    3817           end case 
    3818            
    3819            
    3820            
    3821           memname = memref.name 
    3822            
    3823            
    3824           mDisplayWaitStatusText me, "Processing member:" && memname 
    3825            
    3826            
    3827           -- scrText = memref.scripttext 
    3828            
    3829            
    3830           ------------- once I thought about adding the support for metadata directly to the script 
    3831           ------------- metadata like thumbnail path, script type etc.  
    3832           ------------- but currently I stick to the memberInfo.xml approach to store the metadata 
    3833           ------------- so the following is disabled ... meanwhile... 
    3834           ------------- the "memberInfo.xml" approach is more svn like anyway 
    3835            
    3836            
    3837           --          ------------------------------ check for existing meta data 
    3838           --           
    3839           --          export_meta_data = scrText&"" 
    3840           --          offs = offset("-- -- -- export_meta_data", export_meta_data) 
    3841           --          if offs > 0 then 
    3842           --            delete char 1 to offs + 24 of export_meta_data 
    3843           --            offs = offset("-- -- -- // export_meta_data", export_meta_data) 
    3844           --            if offs > 0 then 
    3845           --              delete char offs to length(export_meta_data) of export_meta_data 
    3846           --            end if 
    3847           --            numlines = export_meta_data.line.count 
    3848           --            repeat with l = 1 to numlines 
    3849           --              thisLine = export_meta_data.line[l] 
    3850           --               
    3851           --            end repeat 
    3852           --          end if 
    3853           --           
    3854           --          ------------------------------ 
    3855            
    3856            
    3857           theDefaultName = memname 
    3858            
    3859           doit = 1 
    3860            
    3861           if length(theDefaultName) < 1 then 
    3862             theDefaultName =  "member" & n & "_" & m 
    3863             memref.name = theDefaultName 
    3864             -- 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           else 
    3868              
    3869             if memref <> member(theDefaultName, m) then 
    3870               put "Member" && memref && "is duplicate. Member with duplicate names are not supported" 
    3871               next repeat 
    3872             end if 
    3873              
    3874           end if 
    3875            
    3876            
    3877            
    3878           -- if offset(".", theDefaultName) < 1 then put ".ls" after theDefaultName 
    3879            
    3880           theDefaultName = mStripFunnyCharsFromFileName(me, theDefaultName) 
    3881            
    3882            
    3883           origname = theDefaultName&"" 
    3884           if length(theDefaultName) > 25 and isMac then 
    3885              
    3886             ms = string(the milliseconds) 
    3887             mlen = length(ms) 
    3888             ms = char mlen - 6 to mlen of ms 
    3889              
    3890             theDefaultName = char 1 to 18 of theDefaultName 
    3891             theDefaultName = theDefaultName & ms -- trim filenames as the mac version of fileio wants to deal with 31 chars 
    3892              
    3893           end if 
    3894            
    3895            
    3896            
    3897           ------------------------------------------ trac subversion support works better with unix linebreaks... 
    3898           if voidP(convertLineBreaksToUnix) then convertLineBreaksToUnix = 1 
    3899           if convertLineBreaksToUnix = "" then convertLineBreaksToUnix = 1 
    3900            
    3901           if convertLineBreaksToUnix = 1 then 
    3902              
    3903             if mCheckForXtra(me, "Pregex") = 1 then 
    3904                
    3905               scrTextLi = [scrText] 
    3906               pregex_replace(scrTextLi, "\x0D\x0A?", "g", "\x0A") 
    3907               scrText = scrTextLi[1] 
    3908                
    3909             else 
    3910                
    3911               fndStr = numToChar(13) & numToChar(10) 
    3912               offs = offset(fndStr, scrText) 
    3913               repeat while offs > 0 
    3914                 delete char offs of scrText 
    3915                 offs = offset(fndStr, scrText) 
    3916               end repeat 
    3917                
    3918               fndStr = numToChar(13) 
    3919               offs = offset(fndStr, scrText) 
    3920               repeat while offs > 0 
    3921                 put numToChar(10) into char offs of scrText 
    3922                 offs = offset(fndStr, scrText) 
    3923               end repeat 
    3924                
    3925             end if 
    3926           end if 
    3927           ----------------------------------------- 
    3928            
    3929            
    3930           if theDefaultName <> origname then 
    3931             alterText = "" 
    3932             snam = baShortFileName(thisFolder & origname & ext) 
    3933             if length(snam) > 0 then 
    3934               alterText = mGetTextFromFile(me, thisFolder & origname & ext) 
    3935             end if 
    3936           else 
    3937             alterText = mGetTextFromFile(me, thisFolder & theDefaultName & ext) 
    3938           end if 
    3939            
    3940           if alterText <> scrText then 
    3941              
    3942             --------------------- compare without whitespaces: 
    3943             noChanges = (mRemoveWhiteSpaces(me, scrText&"") = mRemoveWhiteSpaces(me, alterText&"")) 
    3944              
    3945             if noChanges = 0 then 
    3946                
    3947                
    3948               mSaveToTextFile me, scrText, thisFolder & theDefaultName & ext 
    3949                
    3950                
    3951               bmexp = 0 
    3952               if skipIcons <> 1 then 
    3953                  
    3954                 thumbmember = new(#bitmap) 
    3955                 thumbmember.picture = memref.thumbnail 
    3956                  
    3957                 if thumbmember.width > 0 then 
    3958                   bmexp = 1 
    3959                   if baFileExists(thisFolder & theDefaultName & ".png") then baDeleteFile(thisFolder & theDefaultName & ".png") 
    3960                    
    3961                   if objectP(DirectImageInstance) then 
    3962                      
    3963                     DirectImageInstance.imageLoadFromMember(thumbmember) 
    3964                     DirectImageInstance.imageSaveToFile(thisFolder & theDefaultName & ".png", 100, 1,1) 
    3965                      
    3966                   else if objectP(SharpExportInst) then 
    3967                     mExportBM me, thumbmember, thisFolder & theDefaultName & ".png", "png", 100, SharpExportInst 
    3968                      
    3969                   end if 
    3970                    
    3971                 end if 
    3972                  
    3973                 thumbmember.erase() 
    3974                  
    3975               end if 
    3976                
    3977                
    3978               if theDefaultName <> origname then 
    3979                  
    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 & ext 
    3984                 if bmexp = 1 then 
    3985                   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 if 
    3990                  
    3991               end if 
    3992                
    3993               if origname <> memname then 
    3994                 put "Renamed member" && memref && "to" && origname & ". Scriptmember names must not be emoty or contain illegal characters (SPACE, /, :, \, &)" 
    3995               end if 
    3996                
    3997             end if 
    3998           end if 
    3999            
    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 sensitive 
    4003           -- I am more comfortable with not relying on case insensitivity of filesystems) 
    4004            
    4005         end if 
    4006          
    4007          
    4008       end repeat 
    4009     end repeat 
    4010      
    4011     if doit = 1 then 
    4012       --      mSaveList_2_XML me, infolist, infolistPath 
    4013        
    4014       mRefreshMemberInfoList me, thisFolder, m, infolist 
    4015     end if 
    4016      
    4017      
    4018   end repeat 
    4019    
    4020   DirectImageInstance = 0 
    4021   SharpExportInst = 0 
    4022    
    4023   if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    4024    
    4025 end 
    4026  
    4027 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4028  
    4029 on mRefreshMemberInfoList me, thisFolder, theCastlibNumber, infolist 
    4030    
    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 theCastlibNumber 
    4040    
    4041   repeat with n = 1 to cnt  
    4042      
    4043     memref = member(n, theCastlibNumber) 
    4044      
    4045     memtype = memref.type 
    4046      
    4047     -- if [#script].getPos(memtype) > 0 then 
    4048     if [#script, #field, #text].getPos(memtype) > 0 then 
    4049        
    4050       case memtype of 
    4051            
    4052           ----------------------- 
    4053         #script: 
    4054           ext = ".ls" 
    4055           scrtype = memref.scripttype 
    4056           ----------------------- 
    4057         #field: 
    4058           ext = ".txt" 
    4059           scrtype = #field 
    4060           ----------------------- 
    4061         #text: 
    4062           ext = ".html" 
    4063           scrtype = #text 
    4064           ----------------------- 
    4065         otherwise: 
    4066           ext = ".txt" 
    4067           scrtype = #field 
    4068            
    4069       end case 
    4070        
    4071       memname = memref.name 
    4072        
    4073       theDefaultName = memname 
    4074        
    4075       doit = 1 
    4076        
    4077       if length(theDefaultName) < 1 then 
    4078          
    4079         put "Member" && memref && "has no name, therefore skipped" 
    4080          
    4081         --      if length(theDefaultName) < 1 then 
    4082         --        theDefaultName =  "member" & n & "_" & theCastlibNumber 
    4083         --        alert memref && "has no membername! Member without names will cause trouble when re-importing the scripts."  
    4084         --      end if 
    4085          
    4086       else 
    4087          
    4088         if memref <> member(theDefaultName, theCastlibNumber) then 
    4089           put "Member" && memref && "is duplicate. Member with duplicate names are not supported" 
    4090            
    4091         else 
    4092           theDefaultName = mStripFunnyCharsFromFileName(me, theDefaultName) 
    4093            
    4094            
    4095           origname = theDefaultName&"" 
    4096            
    4097           oldlist = infolist.getaprop(symbol(origname)) 
    4098           if not(listP(oldlist)) then 
    4099             oldlist = [:] 
    4100             fname = origname 
    4101             snam = baShortFileName(thisFolder & origname & ext) 
    4102             if length(snam) < 1 then 
    4103               put "Something seems wrong here. baShortFileName for " & thisFolder & origname & ext && "returned false. The file doesn't seem to exist!" 
    4104             end if 
    4105             oldlist.setaprop(#fname, origname) 
    4106           end if 
    4107           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 sensitive 
    4114           -- I am more comfortable with not relying on case insensitivity of filesystems) 
    4115            
    4116         end if 
    4117       end if 
    4118     end if 
    4119      
    4120   end repeat 
    4121    
    4122   if doit = 1 then mSaveList_2_XML me, newInfolist, infolistPath 
    4123    
    4124    
    4125 end 
    4126  
    4127 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4128  
    4129 on mStripFunnyCharsFromFileName me, theFileName 
    4130    
    4131   offs = offset(" ", theFileName) 
    4132   repeat while offs > 0 
    4133     put "_" into char offs of theFileName 
    4134     offs = offset(" ", theFileName) 
    4135   end repeat 
    4136    
    4137   offs = offset("/", theFileName) 
    4138   repeat while offs > 0 
    4139     put "_" into char offs of theFileName 
    4140     offs = offset("/", theFileName) 
    4141   end repeat 
    4142    
    4143   offs = offset(":", theFileName) 
    4144   repeat while offs > 0 
    4145     put "_" into char offs of theFileName 
    4146     offs = offset(":", theFileName) 
    4147   end repeat 
    4148    
    4149   offs = offset("\", theFileName) 
    4150   repeat while offs > 0 
    4151     put "_" into char offs of theFileName 
    4152     offs = offset("\", theFileName) 
    4153   end repeat 
    4154    
    4155   offs = offset("&", theFileName) 
    4156   repeat while offs > 0 
    4157     put "_" into char offs of theFileName 
    4158     offs = offset("&", theFileName) 
    4159   end repeat 
    4160    
    4161   return theFileName 
    4162    
    4163 end 
    4164  
    4165  
    4166 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4167  
    4168 on mRemoveWhiteSpaces me, theText 
    4169    
    4170   if mCheckForXtra(me, "Pregex") = 1 then 
    4171      
    4172     theText = [theText] 
    4173     PRegEx_Replace(theText, "\s" , "g", "") 
    4174     return theText[1] 
    4175      
    4176   else 
    4177     whitespaces = [" ", RETURN] 
    4178     repeat with ws = count(whitespaces) down to 1 
    4179       theText = mReplaceChunk(me, theText, whitespaces[ws], "") 
    4180     end repeat 
    4181   end if 
    4182    
    4183   return theText 
    4184    
    4185 end 
    4186 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4187  
    4188 -- using offset() -> no pregex 
    4189 on mReplaceChunk me, srcText, fromChunk, toChunk 
    4190    
    4191   stelle = offset(fromChunk, srcText) 
    4192    
    4193   if stelle then 
    4194      
    4195     len = fromChunk.length 
    4196     newtext = "" 
    4197     replText = toChunk 
    4198      
    4199     repeat while stelle 
    4200        
    4201       if stelle > 1 then put char 1 to (stelle - 1) of srcText & replText after newtext 
    4202       else put replText after newtext 
    4203        
    4204       delete char 1 to (stelle + len - 1) of srcText 
    4205        
    4206       stelle = offset(fromChunk, srcText) 
    4207        
    4208       if stelle = 0 then put srcText after newtext 
    4209        
    4210     end repeat 
    4211      
    4212   else -- no match 
    4213      
    4214     return srcText 
    4215   end if 
    4216    
    4217   return newtext 
    4218 end 
    4219  
    4220  
    4221  
    4222 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4223  
    4224 on mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath, selectionOnly 
    4225    
    4226   if selectionOnly = 1 then 
    4227     mUpdateSelectedScriptsFromFolder me, chooseNewPath 
    4228     exit 
    4229   end if 
    4230    
    4231    
    4232   workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
    4233   if ilk(workingCopies) <> #proplist then workingCopies = [:] 
    4234    
    4235   if chooseNewPath = 1 then 
    4236     thePath = "" 
    4237   else 
    4238     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 if 
    4240    
    4241    
    4242   if length(thePath) < 1 then thePath = mGetFolderPathFromUser(me) 
    4243    
    4244   if length(thePath) < 1 then exit 
    4245    
    4246   if mCheckForXtra(me, "budapi") then 
    4247      
    4248     statusSwitched = mSwitchToStatusMode(me, 1) 
    4249      
    4250     if baFileExists(thePath & "memberInfo.xml") then 
    4251       mUpdateScriptCastlibFromFolder me, thePath 
    4252     else 
    4253       folderlist = bafolderlist(thePath) 
    4254       delim = the last char of the applicationpath 
    4255       cnt = count(folderlist) 
    4256       repeat with n = 1 to cnt 
    4257         if folderlist[n] starts "castlib" then 
    4258           mUpdateScriptCastlibFromFolder me, thePath & folderlist[n] & delim 
    4259         end if 
    4260       end repeat 
    4261     end if 
    4262      
    4263     if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    4264      
    4265   else 
    4266      
    4267     alert "Hey, buddyAPI not found! Please install this must-have xtra. And try again." 
    4268      
    4269   end if 
    4270    
    4271 end 
    4272  
    4273  
    4274 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4275  
    4276 on mUpdateScriptCastlibFromFolder me, thePath 
    4277    
    4278   infoList = mReadXML_2_List(me, thePath & "memberInfo.xml") 
    4279    
    4280   if ilk(infoList) <> #proplist then 
    4281     alert thePath && "memberInfo.xml has no data! Can't update folder:" & thePath 
    4282     return false 
    4283   end if 
    4284    
    4285   olddelim = the itemdelimiter 
    4286   delim = the last char of the applicationpath 
    4287   the itemdelimiter = delim 
    4288   fd = thePath 
    4289   if the last char of fd = delim then delete the last char of fd 
    4290   fd = the last item of fd 
    4291   the itemdelimiter = olddelim 
    4292    
    4293   if not(fd starts "castlib") then 
    4294     alert thePath && "does not seem to be valid, as its name doesn't start with " & QUOTE & "castlib" & QUOTE 
    4295     return false 
    4296   end if 
    4297    
    4298   delete char 1 to 7 of fd 
    4299   fd = integer(word 1 of fd) 
    4300    
    4301   if not(integerP(fd)) then 
    4302     alert thePath && "does not seem to be valid, as its name doesn't yield a castlib number:" && fd 
    4303     return false 
    4304   end if 
    4305    
    4306    
    4307   if fd > the number of castlibs then 
    4308     alert thePath && "points to a non-existant castlib (castlib" && fd & "). Please create the castlib before improting the scripts." 
    4309     return false 
    4310   end if 
    4311    
    4312   cnt = count(infoList) 
    4313   repeat with n = 1 to cnt 
    4314     thisMemberInfo = infoList[n] 
    4315     fname = string(thisMemberInfo.getaprop(#fname)) 
    4316     if length(fname) < 1 then fname = string(infoList.getPropAt(n)) 
    4317     fpath = thePath & fname 
    4318      
    4319     scrtype = thisMemberInfo.getaprop(#scripttype) 
    4320     case scrtype of 
    4321       #field: ext = ".txt" 
    4322       #text: ext = ".html" 
    4323       otherwise: ext = ".ls" 
    4324     end case 
    4325      
    4326     mImportScriptWithThumbnail me, fpath & ext, fd, 1, thisMemberInfo 
    4327      
    4328   end repeat 
    4329    
    4330    
    4331   return true 
    4332 end 
    4333  
    4334  
    4335 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4336  
    4337 on mUpdateSelectedScriptsFromFolder me, chooseNewPath 
    4338    
    4339   workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
    4340   if ilk(workingCopies) <> #proplist then workingCopies = [:] 
    4341    
    4342   if chooseNewPath = 1 then 
    4343     thePath = "" 
    4344   else 
    4345     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 if 
    4347    
    4348    
    4349   if length(thePath) < 1 then thePath = mGetFolderPathFromUser(me) 
    4350    
    4351   if length(thePath) < 1 then exit 
    4352    
    4353   cl = the activecastlib 
    4354    
    4355   olddelim = the itemdelimiter 
    4356   the itemdelimiter = the last char of the applicationpath 
    4357   fname = thePath 
    4358   delete the last item of fname 
    4359   fname = the last item of fname 
    4360   the itemdelimiter = olddelim 
    4361    
    4362   infolist = 0 
    4363    
    4364   if fname <> "castlib" & the number of castlib cl then 
    4365      
    4366     newPath = thePath & "castlib" & the number of castlib cl & the last char of the applicationpath 
    4367      
    4368     if baFolderExists(newPath) = 0 then 
    4369        
    4370       infolistPath = thePath & "memberInfo.xml" 
    4371        
    4372       infolist = mReadXML_2_List(me, infolistPath) 
    4373        
    4374       if ilk(infolist) <> #proplist then 
    4375          
    4376         alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    4377         return 0 
    4378          
    4379       else 
    4380          
    4381         thePath = newPath 
    4382          
    4383       end if 
    4384        
    4385     else 
    4386        
    4387       thePath = newPath 
    4388        
    4389     end if 
    4390      
    4391   end if 
    4392    
    4393    
    4394   if infolist = 0 then 
    4395      
    4396     infolistPath = thePath & "memberInfo.xml" 
    4397     infolist = mReadXML_2_List(me, infolistPath) 
    4398      
    4399     if ilk(infolist) <> #proplist then 
    4400        
    4401       alert "The specified folder (" & infolistPath & ") doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    4402       return 0 
    4403        
    4404     end if 
    4405      
    4406   end if 
    4407    
    4408    
    4409   if count(infolist) < 1 then 
    4410      
    4411     alert "The specified folder (" & infolistPath & ") doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    4412     return 0 
    4413      
    4414   end if 
    4415    
    4416    
    4417   cl = the activecastlib 
    4418   sel = the selection of castlib cl 
    4419   anz = sel.count 
    4420   cnt = count(infolist) 
    4421    
    4422   --  put "mUpdateSelectedScriptsFromFolder: infolist = " & infolist 
    4423    
    4424   repeat with n = 1 to anz 
    4425     repeat with m = sel[n][1] to sel[n][2] 
    4426       memref = member(m, cl) 
    4427       dertyp = memref.type 
    4428        
    4429       if [#script, #text, #field].getPos(dertyp) > 0 then 
    4430          
    4431         found = 0 
    4432         repeat with l = 1 to cnt 
    4433           li = infolist[l] 
    4434           if li.getaprop(#memberName) = memref.name then 
    4435              
    4436             fname = string(infolist[l].getaprop(#fname)) 
    4437             if length(fname) < 1 then fname = string(infolist.getpropat(l)) 
    4438              
    4439             case dertyp of 
    4440               #text: ext = ".html" 
    4441               #field: ext = ".txt" 
    4442               otherwise: ext = ".ls"     
    4443             end case 
    4444              
    4445             fpath = thePath & fname & ext 
    4446              
    4447             found = 1 
    4448              
    4449             if baFileExists(fpath) then 
    4450               mImportScriptWithThumbnail me, fpath, the number of castlib cl, 1, li 
    4451                
    4452               put "mUpdateSelectedScriptsFromFolder: imported scripttext of" && memref && "from" && fpath 
    4453                
    4454             else 
    4455               put "mUpdateSelectedScriptsFromFolder: file doesn't exist ?? fpath = " & fpath 
    4456                
    4457             end if 
    4458              
    4459           end if 
    4460         end repeat 
    4461          
    4462          
    4463         if found = 0 then 
    4464           put "Info for member" && memref && "was not found in memberinfo.xml" 
    4465         end if 
    4466          
    4467       end if 
    4468     end repeat 
    4469   end repeat 
    4470    
    4471    
    4472    
    4473   return 1 
    4474    
    4475 end 
    4476  
    4477 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4478  
    4479 on mImportScriptWithThumbnail me, thePath, castlibNumber, dontWarn, infolist 
    4480    
    4481   -- <castlibNumber> is optional and will replace an existing script, if it exists 
    4482    
    4483   castlibNumber = integer(castlibNumber) 
    4484   if ilk(castlibNumber, #number) <> 1 then castlibNumber = 0 
    4485   if castlibNumber > the number of castlibs or castlibNumber = 0 then 
    4486     cl = the activecastlib 
    4487     castlibNumber = the number of castlib cl 
    4488   end if 
    4489    
    4490    
    4491   thePath = string(thePath) 
    4492   if length(thePath) < 1 then thePath = mGetFilePathFromUser(me) 
    4493    
    4494   if length(thePath) < 1 then exit 
    4495    
    4496   if mCheckForXtra(me, "budapi") then 
    4497     buddyApiPresent = 1 
    4498     spath = bashortfilename(thePath) 
    4499     if length(spath) < 1 then 
    4500       alert "file does not exist:" && spath 
    4501       exit 
    4502     end if 
    4503   else 
    4504     buddyApiPresent = 0 
    4505     spath = thePath 
    4506   end if 
    4507    
    4508    
    4509   mDisplayWaitStatusText me, "Importing file:" && spath 
    4510    
    4511    
    4512   scrtext = mGetTextFromFile(me, spath) 
    4513    
    4514   if length(scrtext) < 1 then 
    4515     alert "file not found:" && spath 
    4516     return 0 
    4517   end if 
    4518    
    4519   oldd = the itemdelimiter 
    4520   the itemdelimiter = the last char of the applicationpath 
    4521   fname = the last item of thePath 
    4522   delete the last item of thePath 
    4523   put the itemdelimiter after thePath 
    4524    
    4525   extension = "" 
    4526   repeat while length(fname) 
    4527     put the last char of fname before extension 
    4528     delete the last char of fname 
    4529     if char 1 of extension = "." then exit repeat 
    4530   end repeat 
    4531   if char 1 of extension <> "." then 
    4532     put extension after fname 
    4533     extension = "" 
    4534   end if 
    4535    
    4536   if ilk(infolist) <> #proplist then 
    4537     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 if 
    4544    
    4545   scrtype = infolist.getaprop(#scripttype) 
    4546   if ilk(scrtype) <> #symbol then 
    4547     ident = "-- scripttype = " 
    4548     scrtype = offset(ident, scrtext) 
    4549     if scrtype > 0 then 
    4550       scrtype = scrtext.word[scrtext.char[1 .. scrtype+length(ident) - 1].word.count + 1] 
    4551       scrtype = value(scrtype) 
    4552       if ilk(scrtype) <> #symbol then scrtype = 0 
    4553     end if 
    4554   end if 
    4555    
    4556    
    4557   cmts = infolist.getaprop(#comments) 
    4558   if voidP(cmts) then 
    4559     ident = "-- comments = " 
    4560     cmts = offset(ident, scrtext) 
    4561     if cmts > 0 then 
    4562       cmts = scrtext.line[scrtext.char[1 .. cmts+length(ident) - 1].line.count] 
    4563       delete char 1 to length(ident) - 1 of cmts 
    4564     end if 
    4565   end if 
    4566    
    4567    
    4568   theIcon = thePath & fname & ".png" 
    4569    
    4570   --  if length(fname & ".png") > 31 and (the platform contains "mac") then 
    4571   --     
    4572   --    unixname = baUnixName(theIcon) 
    4573   --    if length(unixname) > 0 then 
    4574   --      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 &QUOTE) 
    4577   --      theIcon = baHFSName(tempSrcPath) 
    4578   --    else 
    4579   --      theIcon = "" 
    4580   --    end if 
    4581   --     
    4582   --  end if 
    4583    
    4584   if buddyApiPresent = 1 then theIcon = bashortfilename(theIcon) 
    4585    
    4586    
    4587   fio = new(xtra "fileio") 
    4588   if length(theIcon) > 0 then 
    4589     fio.openFile(theIcon, 1) 
    4590     if fio.status() = 0 then 
    4591       i = new(#bitmap) 
    4592       i.importFileInto(theIcon) 
    4593       theIcon = i.picture 
    4594       fio.closeFile() 
    4595     end if 
    4596   end if 
    4597    
    4598    
    4599   membername = infolist.getaprop(#membername) 
    4600   if voidP(membername) then 
    4601     scrname = fname 
    4602   else 
    4603     scrname = string(membername) 
    4604   end if 
    4605    
    4606    
    4607   case scrtype of 
    4608     #field, #text: memtype = scrtype 
    4609     otherwise: memtype = #script 
    4610   end case 
    4611    
    4612    
    4613   askreplace = 1 
    4614   scr = member(scrname, castlibNumber) 
    4615   if voidP(scr) then 
    4616     scr = new(memtype, castlib(castlibNumber)) 
    4617     askreplace = 0 
    4618   end if 
    4619   if scr.type <> #script then 
    4620     scr = new(memtype, castlib(castlibNumber)) 
    4621     askreplace = 0 
    4622   end if 
    4623    
    4624   if dontWarn = 1 then askreplace = 0 
    4625    
    4626   if askreplace = 1 then 
    4627     if buddyApiPresent = 1 then 
    4628       if baMsgBox("Replace member" && scrname, "Replace", "Yesno", "Warning", 1) = "No" then 
    4629         if ilk(i) = #member then i.erase() 
    4630         fio = 0 
    4631         return 0 
    4632       end if 
    4633     end if 
    4634   end if 
    4635    
    4636   scr.name = scrname 
    4637    
    4638    
    4639    
    4640   ------------------------------------------ trac subversion support works better with unix linebreaks... 
    4641   if mCheckForXtra(me, "Pregex") = 1 then 
    4642      
    4643     scrTextLi = [scrText] 
    4644     if the platform contains "mac" then 
    4645       pregex_replace(scrTextLi, "\x0D?\x0A", "g", "\x0D") 
    4646     else 
    4647       pregex_replace(scrTextLi, "\x0D([^\x0A])", "g", "\x0D\x0A\1") 
    4648       pregex_replace(scrTextLi, "([^\x0D])\x0A", "g", "\1\x0D\x0A") 
    4649     end if 
    4650     scrText = scrTextLi[1] 
    4651      
    4652   else 
    4653      
    4654     if the platform contains "mac" then 
    4655        
    4656       -- first convert windows to mac 
    4657       fndStr = numToChar(13) & numToChar(10) 
    4658       offs = offset(fndStr, scrText) 
    4659       repeat while offs > 0 
    4660         put numToChar(13) into char offs to offs+1 of scrText 
    4661         offs = offset(fndStr, scrText) 
    4662       end repeat 
    4663        
    4664       -- now convert unix to mac 
    4665       fndStr = numToChar(10) 
    4666       offs = offset(fndStr, scrText) 
    4667       repeat while offs > 0 
    4668         put numToChar(13) into char offs of scrText 
    4669         offs = offset(fndStr, scrText) 
    4670       end repeat 
    4671        
    4672     else 
    4673        
    4674        
    4675       --      fndStr = numToChar(13) & numToChar(10) 
    4676       --      offs = offset(fndStr, scrText) 
    4677       --      repeat while offs > 0 
    4678       --        delete char offs of scrText 
    4679       --        offs = offset(fndStr, scrText) 
    4680       --      end repeat 
    4681        
    4682       fndStr = numToChar(13) & numToChar(10) 
    4683       offs = offset(fndStr, scrText) 
    4684       repeat while offs > 0 
    4685         put numToChar(13) into char offs+1 of scrText 
    4686         offs = offset(fndStr, scrText) 
    4687       end repeat 
    4688        
    4689        
    4690       fndStr = numToChar(10) 
    4691       offs = offset(fndStr, scrText) 
    4692       repeat while offs > 0 
    4693         put numToChar(13) into char offs of scrText 
    4694         offs = offset(fndStr, scrText) 
    4695       end repeat 
    4696        
    4697     end if 
    4698      
    4699   end if 
    4700   ----------------------------------------- 
    4701    
    4702    
    4703    
    4704   case scrtype of 
    4705     #field: scr.text = scrtext 
    4706     #text: scr.html = scrtext 
    4707     otherwise: scr.scripttext = scrtext 
    4708   end case 
    4709    
    4710    
    4711   if [#movie, #parent, #score].getPos(scrtype) > 0 then scr.scripttype = scrtype 
    4712   if cmts <> 0 then scr.comments = cmts 
    4713   if ilk(theIcon) = #picture then scr.thumbnail = theIcon 
    4714    
    4715   if ilk(i) = #member then i.erase() 
    4716   fio = 0 
    4717    
    4718    
    4719   mDisplayWaitStatusText me, "Imported file:" && spath && "into member" && scr 
    4720    
    4721    
    4722   return 1 
    4723    
    4724 end 
    4725  
    4726  
    4727 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4728 on _______________SVN_FIELD_TEXT me 
    4729 end 
    4730 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4731  
    4732 on mExportTextAndFieldsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional 
    4733   mExportScriptsToFolder me, skipIcons_optional, selectionOnly_optional, convertLineBreaksToUnix, chooseNewPath_optional 
    4734 end 
    4735  
    4736 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4737  
    4738 on mImportTextAndFields me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional 
    4739   mImportScriptWithThumbnail me, thePath_optional, castlibNumber_optional, dontWarn_optional, infolist_optional 
    4740 end 
    4741  
    4742 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4743 on _______________SVN_SUPPORT me 
    4744 end 
    4745 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4746  
    4747 on mSVN_Update_Working_Copy_ScriptText me, chooseNewPath 
    4748    
    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 exit 
    4754    
    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 exit 
    4757    
    4758   if the platform contains "mac" then 
    4759     svnBinary = baUnixName(svnBinary) 
    4760     workingFolder = baUnixName(workingFolder) 
    4761   else 
    4762     if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
    4763   end if 
    4764    
    4765   statusSwitched = mSwitchToStatusMode(me, 1) 
    4766   mDisplayWaitStatusText me, "Updating folder:" && workingFolder 
    4767    
    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 then 
    4773     put theresult[1] 
    4774     alert "Done, see the results of the svn operation in the message window." 
    4775   else 
    4776     alert "svn application did not respond, something seems to have failed. :-(" 
    4777   end if 
    4778    
    4779   setPref("svn_workingCopies_paths.txt", string(workingCopies)) 
    4780    
    4781 end 
    4782  
    4783  
    4784 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    4785  
    4786 on mSVN_Delete_Selected_Scripts me, chooseNewPath 
    4787    
    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 exit 
    4794    
    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 exit 
    4797    
    4798    
    4799   if the platform contains "mac" then 
    4800     isMac = 1 
    4801     svnBinary = baUnixName(svnBinary) 
    4802      
    4803   else 
    4804     isMac = 0 
    4805      
    4806   end if 
    4807    
    4808    
    4809   thePath = workingFolder 
    4810    
    4811   cl = the activecastlib 
    4812    
    4813   pathdelim = the last char of the applicationpath 
    4814   olddelim = the itemdelimiter 
    4815   the itemdelimiter = pathdelim 
    4816   fname = thePath 
    4817   delete the last item of fname 
    4818   fname = the last item of fname 
    4819   the itemdelimiter = olddelim 
    4820    
    4821   infolist = 0 
    4822    
    4823   if fname <> "castlib" & the number of castlib cl then 
    4824      
    4825     newPath = thePath & "castlib" & the number of castlib cl 
    4826      
    4827     if baFolderExists(newPath) = 0 then 
    4828        
    4829       infolistPath = thePath & pathdelim & "memberInfo.xml" 
    4830        
    4831       infolist = mReadXML_2_List(me, infolistPath) 
    4832        
    4833       if ilk(infolist) <> #proplist then 
    4834          
    4835         alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    4836         return 0 
    4837          
    4838       else 
    4839          
    4840         thePath = newPath & pathdelim 
    4841          
    4842       end if 
    4843        
    4844     else 
    4845        
    4846       thePath = newPath & pathdelim 
    4847        
    4848     end if 
    4849   end if 
    4850    
    4851    
    4852   if infolist = 0 then 
    4853      
    4854     infolistPath = thePath & "memberInfo.xml" 
    4855     infolist = mReadXML_2_List(me, infolistPath) 
    4856      
    4857     if ilk(infolist) <> #proplist then 
    4858        
    4859       alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    4860       return 0 
    4861        
    4862     end if 
    4863      
    4864   end if 
    4865    
    4866   if ilk(infolist) <> #proplist then 
    4867      
    4868     alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    4869     return 0 
    4870      
    4871   end if 
    4872    
    4873   if count(infolist) < 1 then 
    4874      
    4875     alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    4876     return 0 
    4877      
    4878   end if 
    4879    
    4880   doCommit = 0 
    4881   saveRequired = 0 
    4882    
    4883   cl = the activecastlib 
    4884   sel = the selection of castlib cl 
    4885   anz = sel.count 
    4886   cnt = count(infolist) 
    4887   repeat with n = 1 to anz 
    4888     repeat with m = sel[n][1] to sel[n][2] 
    4889       memref = member(m, cl) 
    4890       dertyp = memref.type 
    4891        
    4892       put "processing member" && memref 
    4893        
    4894       if [#script, #field, #text].getPos(dertyp) then 
    4895          
    4896         putstr = "" 
    4897         repeat with l = 1 to cnt 
    4898           li = infolist[l] 
    4899            
    4900           -- put "listref  =" && li 
    4901            
    4902           if li.getaprop(#memberName) = memref.name then 
    4903              
    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 of 
    4909               #field: ext = ".txt" 
    4910               #text: ext = ".html" 
    4911               otherwise: ext = ".ls" 
    4912             end case 
    4913              
    4914             fpath = thePath & theFilename & ext 
    4915              
    4916             put "checking for file" && fpath 
    4917              
    4918             if isMac = 1 then 
    4919               sname = baShortFileName(fpath) 
    4920             else 
    4921               sname = fpath 
    4922             end if 
    4923              
    4924             if baFileExists(fpath) then 
    4925                
    4926               if isMac = 1 then 
    4927                 ufpath =  baUnixName(fpath) 
    4928               else 
    4929                 ufpath =  fpath 
    4930               end if 
    4931                
    4932               theresult = shell_cmd_list(svnBinary && "delete" && QUOTE & ufpath & QUOTE) 
    4933               if count(theresult) < 1 then 
    4934                 put "failed to svn delete member " & memref & " no result from svn?!" 
    4935               else 
    4936                 put theresult[1] 
    4937                 doCommit = 1 
    4938               end if 
    4939                
    4940               infolist.deleteAt(l) 
    4941               memref.erase() 
    4942               saveRequired = 1 
    4943               put "Erase member:" && memref.name 
    4944                
    4945               putstr = "" 
    4946                
    4947               exit repeat 
    4948                
    4949             else 
    4950                
    4951               putstr = "No corresponding file o disk was found for member" && memref.name && "(" & memref & ") erase the member manually:" & RETURN & memref & ".erase()" & RETURN 
    4952                
    4953             end if 
    4954              
    4955           end if 
    4956            
    4957         end repeat 
    4958          
    4959         if length(putstr) then put putstr 
    4960          
    4961       end if 
    4962     end repeat 
    4963   end repeat 
    4964    
    4965    
    4966   if saveRequired = 1 then 
    4967      
    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") then 
    4969       saveMovie() 
    4970     end if 
    4971      
    4972     mRefreshMemberInfoList me, thePath, castlib(cl).number 
    4973      
    4974   end if 
    4975    
    4976    
    4977   if doCommit = 1 then 
    4978      
    4979     msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2) 
    4980      
    4981     if length(msg) < 1 then 
    4982       alert "You must enter a message for the commit action." 
    4983       exit 
    4984     end if 
    4985      
    4986     if isMac = 1 then 
    4987       workingFolder = baUnixName(workingFolder) 
    4988     else 
    4989       if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
    4990     end if 
    4991      
    4992     theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE && QUOTE & workingFolder & QUOTE) 
    4993      
    4994     if count(theresult) > 0 then 
    4995       put theresult[1] 
    4996       alert "Done, see the results of the svn operation in the message window." 
    4997     else 
    4998       alert "svn application did not respond, something seems to have failed. :-(" 
    4999     end if 
    5000      
    5001   else 
    5002      
    5003     alert "Nothing has been committed!" 
    5004      
    5005   end if 
    5006    
    5007   return 1 
    5008    
    5009 end 
    5010  
    5011  
    5012 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5013  
    5014 on mSVN_Commit_CurrentMovie_Binaries_AND_Scripttext me, chooseNewPath, commitMsg 
    5015    
    5016   commitMsg = string(commitMsg) 
    5017   if length(commitMsg) < 1 then 
    5018     commitMsg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2) 
    5019      
    5020     if length(commitMsg) < 1 then 
    5021       alert "You must enter a message for the commit action." 
    5022       exit 
    5023     end if 
    5024   end if 
    5025    
    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 end 
    5033  
    5034 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5035  
    5036 on mSVN_Commit_SelectedCastlib_AND_Scripttext me, chooseNewPath, commitMsg, selectionList 
    5037    
    5038   commitMsg = string(commitMsg) 
    5039   if length(commitMsg) < 1 then 
    5040     commitMsg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2) 
    5041      
    5042     if length(commitMsg) < 1 then 
    5043       alert "You must enter a message for the commit action." 
    5044       exit 
    5045     end if 
    5046   end if 
    5047    
    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 end 
    5055  
    5056 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5057  
    5058 on mSVN_Commit_SelectedCastlib me, chooseNewPath, commitMsg, dontSave, dontShowAlert, selectionList 
    5059    
    5060    
    5061   castlibList = 0 
    5062   selectionList = string(selectionList) 
    5063   if length(selectionList) > 0 then 
    5064     if char 1 of selectionList <> "[" then put "[" before selectionList 
    5065     if the last char of selectionList <> "]" then put "]" after selectionList 
    5066     selectionList = value(selectionList) 
    5067     if listP(selectionList) then 
    5068       clnum = the number of castlibs + 1 
    5069       castlibList = [] 
    5070       selectionListCnt = count(selectionList) 
    5071       repeat with n = 1 to selectionListCnt 
    5072         int = integer(selectionList[n]) 
    5073         if integerP(int) then 
    5074           if clnum > int then 
    5075             if castlibList.getPos(int) < 1 then castlibList.add(int) 
    5076           end if 
    5077         end if 
    5078       end repeat 
    5079     end if 
    5080   end if 
    5081    
    5082   if castlibList = 0 then 
    5083     castlibList = [] 
    5084     actCL = the activecastlib 
    5085     castlibList.add(actCL) 
    5086   end if 
    5087    
    5088    
    5089   mpname = the moviepath & the moviename 
    5090   isInternal = 0 
    5091   repeat with cl in castlibList 
    5092     if castlib(cl).filename = mpname then 
    5093       isInternal = 1 
    5094       exit repeat 
    5095     end if 
    5096   end repeat 
    5097    
    5098    
    5099   if count(castlibList) < 1 then 
    5100     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 0 
    5102   end if 
    5103    
    5104    
    5105    
    5106   put "Committing castlibs:" && castlibList 
    5107    
    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 0 
    5114    
    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 0 
    5117    
    5118    
    5119   --------------------------------------- 
    5120   msg = string(commitMsg) 
    5121   if length(msg) < 1 then 
    5122     msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2) 
    5123      
    5124     if length(msg) < 1 then 
    5125       alert "You must enter a message for the commit action." 
    5126       return 0 
    5127     end if 
    5128   end if 
    5129   --------------------------------------- 
    5130    
    5131    
    5132   --------------------------------------- 
    5133   if dontSave <> 1 then 
    5134     -- 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 then 
    5138       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 0 
    5140       if answer = "Always save" then workingCopies.setaprop(#dontWarnWhenSaving, 1) 
    5141     end if 
    5142      
    5143     --    if the moviepath & the moviename = castlib(actCL).filename then 
    5144     --      savemovie() 
    5145     --    else 
    5146     --      castlib(actCL).save() 
    5147     --   end if 
    5148      
    5149     if isInternal = 1 then 
    5150       savemovie() 
    5151     else 
    5152       repeat with cl in castlibList 
    5153         castlib(cl).save() 
    5154       end repeat 
    5155     end if 
    5156      
    5157   end if 
    5158   ---------------------------------------- 
    5159    
    5160    
    5161   statusSwitched = mSwitchToStatusMode(me, 1) 
    5162   mDisplayWaitStatusText me, "Committing castlibs:" && castlibList 
    5163    
    5164    
    5165    
    5166   --  fname = castlib(actCL).filename 
    5167    
    5168    
    5169   --------------------------------------- 
    5170   if workingFolder <> the moviepath then 
    5171      
    5172     mp = the moviepath 
    5173     mplen = length(mp) 
    5174     olddelim = the itemdelimiter 
    5175     the itemdelimiter = mp 
    5176      
    5177      
    5178     castlibListCnt = count(castlibList) 
    5179     repeat with r = 1 to castlibListCnt 
    5180       cl = castlibList[r] 
    5181        
    5182       fname = castlib(cl).filename 
    5183        
    5184       if length(fname) > 0 then 
    5185          
    5186         offs = offset(mp, fname) 
    5187         if offs <> 1 then 
    5188           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 0 
    5191         end if 
    5192          
    5193         relpath = fname 
    5194         delete char 1 to mplen of relpath 
    5195          
    5196         newpath = workingFolder & relpath 
    5197         newpathDir = newpath 
    5198         delete the last item of newpathDir 
    5199         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       else 
    5205          
    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 0 
    5209          
    5210       end if 
    5211        
    5212     end repeat 
    5213      
    5214      
    5215     the itemdelimiter = olddelim 
    5216      
    5217   else 
    5218      
    5219     castlibListCnt = count(castlibList) 
    5220     repeat with r = 1 to castlibListCnt 
    5221       cl = castlibList[r] 
    5222       newpath = fname 
    5223       castlibList[cl] = [cl, fname, fname] 
    5224     end repeat 
    5225      
    5226   end if 
    5227   --------------------------------------- 
    5228    
    5229    
    5230   --------------------------------------- 
    5231   if the platform contains "mac" then 
    5232     svnBinary = baUnixName(svnBinary) 
    5233     workingFolder = baUnixName(workingFolder) 
    5234      
    5235     castlibListCnt = count(castlibList) 
    5236     repeat with r = 1 to castlibListCnt 
    5237       castlibList[r][3] = baUnixName(castlibList[r][3]) 
    5238     end repeat 
    5239      
    5240   else 
    5241     if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
    5242   end if 
    5243   --------------------------------------- 
    5244    
    5245    
    5246   isChanged = 0 
    5247   castlibListCnt = count(castlibList) 
    5248   repeat with r = 1 to castlibListCnt 
    5249     --    cl = castlibList[r] 
    5250     --  repeat with cl in castlibList 
    5251     --------------------------------------- 
    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 then 
    5258       theresult = shell_cmd_list(svnBinary && "update" && QUOTE & castlibList[r][3] & QUOTE && "2>&1") 
    5259       if count(theresult) < 1 then 
    5260         theError = theresult[1] 
    5261       else 
    5262         theError = "svn did not respond at all." 
    5263       end if 
    5264       alert "Can't proceed svn error while trying to update:" && theError 
    5265       if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    5266       return 0   
    5267     end if 
    5268     --------------------------------------- 
    5269      
    5270      
    5271      
    5272     theresult = shell_cmd_list(svnBinary && "status" && QUOTE & castlibList[r][3] & QUOTE) 
    5273      
    5274     cnt = count(theresult) 
    5275     if cnt > 0 then 
    5276       isChanged = 1 
    5277       --      alert "Apparently there are no changes to the most recent version in the svn repository: svn status is empty" 
    5278       --      return 0 
    5279     end if 
    5280      
    5281   end repeat 
    5282    
    5283   if isChanged = 0 then 
    5284     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 0  
    5287   end if 
    5288    
    5289    
    5290   pathStr = "" 
    5291   castlibListCnt = count(castlibList) 
    5292   repeat with r = 1 to castlibListCnt 
    5293     put " " & QUOTE & castlibList[r][3] & QUOTE after pathStr 
    5294   end repeat 
    5295    
    5296    
    5297   mDisplayWaitStatusText me, "SVN commit for:" && pathStr 
    5298    
    5299   theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE & pathStr) 
    5300    
    5301    
    5302   --------------------------------------- 
    5303   if count(theresult) > 0 then 
    5304     theResult = theresult[1] 
    5305      
    5306     put theResult 
    5307     if dontShowAlert <> 1 then alert "Done, see the results of the svn operation in the message window." 
    5308      
    5309   else 
    5310     if dontShowAlert <> 1 then alert "svn application did not respond, something seems to have failed. :-(" 
    5311   end if 
    5312   --------------------------------------- 
    5313    
    5314   setPref("svn_wCopies_paths_Binary.txt", string(workingCopies)) 
    5315    
    5316   if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    5317    
    5318   return 1 
    5319    
    5320 end 
    5321  
    5322 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5323  
    5324 on mSVN_Commit_CurrentMovie_Binaries me, chooseNewPath, commitMsg, dontSave, dontShowAlert 
    5325    
    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 0 
    5331    
    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 0 
    5334    
    5335    
    5336   --------------------------------------- 
    5337   msg = string(commitMsg) 
    5338   if length(msg) < 1 then 
    5339     msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2) 
    5340      
    5341     if length(msg) < 1 then 
    5342       alert "You must enter a message for the commit action." 
    5343       return 0 
    5344     end if 
    5345   end if 
    5346   --------------------------------------- 
    5347    
    5348    
    5349   --------------------------------------- 
    5350   if dontSave <> 1 then 
    5351     -- 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 then 
    5355       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 0 
    5357       if answer = "Always save" then workingCopies.setaprop(#dontWarnWhenSaving, 1) 
    5358     end if 
    5359      
    5360     statusSwitched = mSwitchToStatusMode(me, 1) 
    5361      
    5362     mDisplayWaitStatusText me, "Saving movie..." 
    5363      
    5364     saveMovie() 
    5365      
    5366   else 
    5367      
    5368     statusSwitched = mSwitchToStatusMode(me, 1) 
    5369      
    5370   end if 
    5371   ---------------------------------------- 
    5372    
    5373    
    5374    
    5375   --------------------------------------- 
    5376   if workingFolder <> the moviepath then 
    5377     erg = baCopyFileProgress(the moviepath & the moviename, workingFolder & the moviename, "Always", "Copying movie to working folder", "", 33) 
    5378     if erg <> 0 then 
    5379       alert "An error occurred during copying the movie:" && erg 
    5380       if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    5381       return 0 
    5382     end if 
    5383     clnum = the number of castlibs 
    5384     mp = the moviepath 
    5385     mplen = length(mp) 
    5386     olddelim = the itemdelimiter 
    5387     the itemdelimiter = mp 
    5388     repeat with n = 2 to clnum 
    5389       fname = castlib(n).filename 
    5390       if length(fname) > 0 then 
    5391          
    5392         if the moviepath & the moviename <> fname then 
    5393           offs = offset(mp, fname) 
    5394           if offs <> 1 then 
    5395             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 0 
    5398           end if 
    5399           relpath = fname 
    5400           delete char 1 to mplen of relpath 
    5401            
    5402           newpath = workingFolder & relpath 
    5403           newpathDir = newpath 
    5404           delete the last item of newpathDir 
    5405           if baFolderExists(newpathDir) <> 1 then baCreateFolder(newpathDir) 
    5406           baCopyFileProgress(fname, newpath, "Always", "Copying castlib " & n & " to working folder", "", 33) 
    5407            
    5408         end if 
    5409          
    5410       end if 
    5411     end repeat 
    5412     the itemdelimiter = olddelim 
    5413   end if 
    5414   --------------------------------------- 
    5415    
    5416   --------------------------------------- 
    5417   if the platform contains "mac" then 
    5418     svnBinary = baUnixName(svnBinary) 
    5419     workingFolder = baUnixName(workingFolder) 
    5420   else 
    5421     if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
    5422   end if 
    5423   --------------------------------------- 
    5424    
    5425    
    5426   --------------------------------------- 
    5427   mDisplayWaitStatusText me, "SVN update for:" && workingFolder 
    5428    
    5429   theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE) 
    5430    
    5431   if count(theresult) < 1 then 
    5432     theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolder & QUOTE && "2>&1") 
    5433     if count(theresult) < 1 then 
    5434       theError = theresult[1] 
    5435     else 
    5436       theError = "svn did not respond at all." 
    5437     end if 
    5438     alert "Can't proceed svn error while trying to update:" && theError 
    5439     if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    5440     return 0   
    5441   end if 
    5442   --------------------------------------- 
    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 -> ugly 
    5448   ------- #2 however "messes" with files, which the user may not expect... 
    5449   ------- I for one prefer #2 anyway, therefore I didn't even implement #1 
    5450   ------- in order to implement #1 you can use a repeat loop just like the above repeat, which goes thorugh each castlib 
    5451    
    5452   theresult = shell_cmd_list(svnBinary && "status" && QUOTE & workingFolder & QUOTE) 
    5453    
    5454   cnt = count(theresult) 
    5455   if cnt < 1 then 
    5456     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 0 
    5459   end if 
    5460    
    5461   repeat with n = 1 to cnt 
    5462     answ = theresult[n] 
    5463     meth = word 1 of answ 
    5464     delete word 1 of answ 
    5465      
    5466     case meth of 
    5467       "!": -- 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 case 
    5469         -- as it may also be the case, that we only have a subset of the castlibs/scripts 
    5470         -- therefore I just skip these files and leave it to the user what to do with them in his svn client application 
    5471         -- we only put a message, so the user is made aware of this fact 
    5472         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 file 
    5476         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:" && answ 
    5484         mDisplayWaitStatusText me, "Update file:" && answ 
    5485          
    5486     end case 
    5487      
    5488   end repeat 
    5489    
    5490   mDisplayWaitStatusText me, "SVN commit of:" && workingFolder 
    5491    
    5492   theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE && QUOTE & workingFolder & QUOTE) 
    5493    
    5494    
    5495   --------------------------------------- 
    5496   if count(theresult) > 0 then 
    5497     theResult = theresult[1] 
    5498      
    5499     put theResult 
    5500     if dontShowAlert <> 1 then alert "Done, see the results of the svn operation in the message window." 
    5501      
    5502   else 
    5503     if dontShowAlert <> 1 then alert "svn application did not respond, something seems to have failed. :-(" 
    5504   end if 
    5505   --------------------------------------- 
    5506    
    5507   setPref("svn_wCopies_paths_Binary.txt", string(workingCopies)) 
    5508    
    5509   if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    5510    
    5511   return 1 
    5512 end 
    5513  
    5514 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5515  
    5516 on mSVN_Update_SelectedCastlib me, chooseNewPath, onlyUpdate_SVN_WorkingFolder, dontShowAlert 
    5517    
    5518   actCL = the activecastlib 
    5519    
    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 exit 
    5525    
    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 exit 
    5528    
    5529    
    5530    
    5531   oldmoviepath = the moviepath 
    5532   oldmovie = oldmoviepath & the moviename 
    5533    
    5534    
    5535   fname = castlib(actCL).filename 
    5536    
    5537   --------------------------------------- 
    5538   if workingFolder <> the moviepath then 
    5539      
    5540     mp = the moviepath 
    5541     mplen = length(mp) 
    5542     olddelim = the itemdelimiter 
    5543     the itemdelimiter = mp 
    5544      
    5545     if length(fname) > 0 then 
    5546        
    5547       offs = offset(mp, fname) 
    5548       if offs <> 1 then 
    5549         alert "Castlib" && castlib(actCL) && "is not within your current moviepath. This is not supported." 
    5550         return 0 
    5551       end if 
    5552        
    5553       relpath = fname 
    5554       delete char 1 to mplen of relpath 
    5555        
    5556       newpath = workingFolder & relpath 
    5557       newpathDir = newpath 
    5558       delete the last item of newpathDir 
    5559       -- if baFolderExists(newpathDir) <> 1 then baCreateFolder(newpathDir) 
    5560       -- baCopyFileProgress(fname, newpath, "Always", "Copying castlib " & actCL & " to working folder", "", 33) 
    5561        
    5562     else 
    5563        
    5564       -- musty something REALLY wrong, as the filename should ALWAYS be of any length (internal castlibs ) 
    5565       return 0 
    5566        
    5567     end if 
    5568      
    5569     the itemdelimiter = olddelim 
    5570      
    5571   else 
    5572      
    5573     newpath = fname 
    5574   end if 
    5575   --------------------------------------- 
    5576    
    5577    
    5578   statusSwitched = mSwitchToStatusMode(me, 1) 
    5579    
    5580    
    5581   doReturnToOldMovie = 0 
    5582    
    5583   if (onlyUpdate_SVN_WorkingFolder <> 1) or (the moviepath contains workingFolder) then 
    5584      
    5585     mDisplayWaitStatusText me, "Temporary switch to new movie in order to replace files" 
    5586      
    5587     ------------------------------ 
    5588     -- close this movie by issuing a "new movie..." command 
    5589     -- in order to replace the current movie, with the updated movie 
    5590     dispatchcommand(4097) 
    5591     ------------------------------ 
    5592      
    5593     doReturnToOldMovie = 1 
    5594      
    5595   end if 
    5596    
    5597    
    5598    
    5599   if the platform contains "mac" then 
    5600     svnBinary = baUnixName(svnBinary) 
    5601     workingFolderUnix = baUnixName(workingFolder) 
    5602     newpathUnix = baUnixName(newpath) 
    5603   else 
    5604     newpathUnix = newpath 
    5605     workingFolderUnix = workingFolder 
    5606     if the last char of workingFolderUnix = the last char of the applicationpath then delete the last char of workingFolderUnix 
    5607   end if 
    5608    
    5609    
    5610   mDisplayWaitStatusText me, "SVN update:" && newpathUnix 
    5611    
    5612   theresult = shell_cmd_list(svnBinary && "update" && QUOTE & newpathUnix & QUOTE) 
    5613    
    5614    
    5615   if count(theresult) > 0 then 
    5616      
    5617     -------- reload the refreshed movie: 
    5618     if the moviepath contains workingFolder then 
    5619        
    5620       -- go to movie the moviepath & the moviename 
    5621        
    5622     else 
    5623        
    5624       if onlyUpdate_SVN_WorkingFolder <> 1 then 
    5625          
    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 workingFolder 
    5628          
    5629         put "Copy file from " & workingFolder & " to " & oldmoviepath 
    5630          
    5631          
    5632         erg = baCopyFileProgress(newpath, fname, "Always", "Replacing castlib with the version of the working folder", "", 33) 
    5633         if erg <> 0 then 
    5634           alert "An error occurred during copying the file (" & newpath & "). Error:" && erg 
    5635         else 
    5636           put "Replaced file:" && newpath 
    5637         end if 
    5638          
    5639          
    5640         ---------------------------------- 
    5641          
    5642       end if 
    5643        
    5644     end if 
    5645      
    5646     put theresult[1] 
    5647      
    5648     if doReturnToOldMovie = 1 then go to movie oldmovie 
    5649      
    5650     if dontShowAlert <> 1 then alert "Done, see the results of the svn operation in the message window." 
    5651      
    5652   else 
    5653      
    5654     if doReturnToOldMovie = 1 then go to movie oldmovie 
    5655      
    5656     if dontShowAlert <> 1 then alert "svn application did not respond, something seems to have failed. :-(" 
    5657   end if 
    5658    
    5659    
    5660   setPref("svn_wCopies_paths_Binary.txt", string(workingCopies)) 
    5661    
    5662   if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    5663    
    5664 end 
    5665  
    5666 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5667  
    5668 on mSVN_Update_CurrentMovie_Binaries me, chooseNewPath, onlyUpdate_SVN_WorkingFolder, dontShowAlert 
    5669    
    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 exit 
    5675    
    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 exit 
    5678    
    5679    
    5680   statusSwitched = mSwitchToStatusMode(me, 1) 
    5681    
    5682    
    5683   if the platform contains "mac" then 
    5684     svnBinary = baUnixName(svnBinary) 
    5685     workingFolderUnix = baUnixName(workingFolder) 
    5686   else 
    5687     workingFolderUnix = workingFolder 
    5688     if the last char of workingFolderUnix = the last char of the applicationpath then delete the last char of workingFolderUnix 
    5689   end if 
    5690    
    5691   oldmoviepath = the moviepath 
    5692   oldmovie = oldmoviepath & the moviename 
    5693    
    5694    
    5695   doReturnToOldMovie = 0 
    5696    
    5697   if (onlyUpdate_SVN_WorkingFolder <> 1) or (the moviepath contains workingFolder) then 
    5698      
    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..." command 
    5704     -- in order to replace the current movie, with the updated movie 
    5705     dispatchcommand(4097) 
    5706     ------------------------------ 
    5707      
    5708     doReturnToOldMovie = 1 
    5709      
    5710   end if 
    5711    
    5712   mDisplayWaitStatusText me, "SVN update:" && workingFolderUnix 
    5713    
    5714   theresult = shell_cmd_list(svnBinary && "update" && QUOTE & workingFolderUnix & QUOTE) 
    5715    
    5716   if count(theresult) > 0 then 
    5717      
    5718     -------- reload the refreshed movie: 
    5719     if the moviepath contains workingFolder then 
    5720        
    5721       -- go to movie the moviepath & the moviename 
    5722        
    5723     else 
    5724        
    5725       if onlyUpdate_SVN_WorkingFolder <> 1 then 
    5726          
    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 workingFolder 
    5729          
    5730         put "Copy files from " & workingFolder & " to " & oldmoviepath 
    5731         mCopyAllFiles(me, workingFolder, oldmoviepath) 
    5732          
    5733         ---------------------------------- 
    5734          
    5735       end if 
    5736        
    5737     end if 
    5738      
    5739     put theresult[1] 
    5740      
    5741     if doReturnToOldMovie = 1 then go to movie oldmovie 
    5742      
    5743     if dontShowAlert <> 1 then alert "Done, see the results of the svn operation in the message window." 
    5744      
    5745   else 
    5746      
    5747     if doReturnToOldMovie = 1 then go to movie oldmovie 
    5748      
    5749     if dontShowAlert <> 1 then alert "svn application did not respond, something seems to have failed. :-(" 
    5750   end if 
    5751    
    5752    
    5753   setPref("svn_wCopies_paths_Binary.txt", string(workingCopies)) 
    5754    
    5755    
    5756   if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    5757    
    5758 end 
    5759  
    5760 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5761  
    5762 on mCopyAllFiles me, fromFolder, toFolder 
    5763    
    5764   flist = baFolderList(fromFolder) 
    5765   flistCnt = count(flist) 
    5766   repeat with n = flistCnt down to 1 
    5767     thisFolder = flist[n] 
    5768     if thisFolder starts ".svn" then next repeat 
    5769     if not(baFolderExists(toFolder & thisFolder)) then 
    5770       put "Attempting to create folder:" && toFolder & thisFolder 
    5771       erg = baCreateFolder(toFolder & thisFolder) 
    5772        
    5773       if erg = 0 then put "successfully created folder" 
    5774       else put "Unable to create folder." 
    5775        
    5776     else 
    5777       erg = 1 
    5778     end if 
    5779      
    5780     if erg = 1 then 
    5781       mCopyAllFiles me, fromFolder & thisFolder & the last char of toFolder, toFolder & thisFolder & the last char of toFolder 
    5782     else 
    5783       alert "Unable to create folder (" & thisFolder & "). Error:" && erg 
    5784     end if 
    5785      
    5786   end repeat 
    5787    
    5788    
    5789    
    5790   flist = baFileList(fromFolder, "") 
    5791   flistCnt = count(flist) 
    5792   repeat with n = 1 to flistCnt 
    5793     thisFile = flist[n] 
    5794     if thisFile starts ".svn" then next repeat 
    5795     erg = baCopyFileProgress(fromFolder & thisFile, toFolder & thisFile, "Always", "Replacing movie with the version of the working folder", "", 33) 
    5796     if erg <> 0 then 
    5797       alert "An error occurred during copying the file (" & thisFile & "). Error:" && erg 
    5798     else 
    5799       put "Replaced file:" && thisFile 
    5800     end if 
    5801   end repeat 
    5802    
    5803    
    5804 end 
    5805  
    5806  
    5807 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    5808  
    5809 on mSVN_Commit_CurrentScripts_ScriptText me, selected_Members_Only, chooseNewPath, commitMsg, dontShowAlert, selectionList 
    5810    
    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 0 
    5816    
    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 0 
    5819    
    5820   msg = string(commitMsg) 
    5821    
    5822    
    5823   if length(msg) < 1 then 
    5824      
    5825     msg = baPrompt("Commit message", "Enter commit message", "Commitmessage", 0, -2, -2) 
    5826      
    5827     if length(msg) < 1 then 
    5828       alert "You must enter a message for the commit action." 
    5829       return 0 
    5830     end if 
    5831      
    5832   end if 
    5833    
    5834    
    5835   if workingCopies.getaprop(#dontWarnWhenSaving) <> 1 then 
    5836     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 0 
    5838     if answer = "Always save" then workingCopies.setaprop(#dontWarnWhenSaving, 1) 
    5839   end if 
    5840    
    5841    
    5842    
    5843   statusSwitched = mSwitchToStatusMode(me, 1) 
    5844    
    5845   clibfolder = "" 
    5846    
    5847   castlibList = 0 
    5848    
    5849    
    5850    
    5851   -------- if we work on only one castlib: 
    5852    
    5853   if ilk(selected_Members_Only) = #castLib then 
    5854      
    5855      
    5856     ----------------------------------------------------- 
    5857      
    5858     selectionList = string(selectionList) 
    5859     if length(selectionList) > 0 then 
    5860        
    5861       if char 1 of selectionList <> "[" then put "[" before selectionList 
    5862       if the last char of selectionList <> "]" then put "]" after selectionList 
    5863        
    5864       selectionList = value(selectionList) 
    5865       if listP(selectionList) then 
    5866         clnum = the number of castlibs + 1 
    5867         castlibList = [] 
    5868         selectionListCnt = count(selectionList) 
    5869         repeat with n = 1 to selectionListCnt 
    5870           int = integer(selectionList[n]) 
    5871           if integerP(int) then 
    5872             if clnum > int then 
    5873               if castlibList.getPos(int) < 1 then castlibList.add(int) 
    5874             end if 
    5875           end if 
    5876         end repeat 
    5877       end if 
    5878     end if 
    5879      
    5880     if castlibList = 0 then 
    5881       castlibList = [] 
    5882       castlibList.add(selected_Members_Only.number) 
    5883     end if 
    5884      
    5885      
    5886     mpname = the moviepath & the moviename 
    5887     isInternal = 0 
    5888     repeat with cl in castlibList 
    5889       if castlib(cl).filename = mpname then 
    5890         isInternal = 1 
    5891         exit repeat 
    5892       end if 
    5893     end repeat 
    5894      
    5895      
    5896     if count(castlibList) < 1 then 
    5897       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 0 
    5900     end if 
    5901      
    5902      
    5903      
    5904     mDisplayWaitStatusText me, "Commiting scripttext for castlibs:" && castlibList 
    5905      
    5906     put "Commiting scripttext for castlibs:" && castlibList 
    5907     ----------------------------------------------------- 
    5908      
    5909     delim = the last char of the applicationpath 
    5910      
    5911     olddelim = the itemdelimiter 
    5912     the itemdelimiter = delim 
    5913      
    5914     repeat with n = count(castlibList) down to 1 
    5915        
    5916       selected_Members_Only = castlib(castlibList[n]) 
    5917        
    5918       mDisplayWaitStatusText me, "Saving castlib:" && selected_Members_Only 
    5919        
    5920       selected_Members_Only.save() 
    5921        
    5922        
    5923        
    5924       if the last item of workingFolder = "castlib" & selected_Members_Only.number then 
    5925         clibfolder = workingFolder 
    5926       else 
    5927         if the last char of workingFolder <> delim then put delim after workingFolder 
    5928         clibfolder = workingFolder & "castlib" & selected_Members_Only.number 
    5929       end if 
    5930        
    5931       castlibList[n] = [castlibList[n], clibfolder, workingFolder] 
    5932       -------- 
    5933        
    5934        
    5935       mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder 
    5936        
    5937     end repeat 
    5938      
    5939     the itemdelimiter = olddelim 
    5940      
    5941      
    5942      
    5943   else -- treat all: 
    5944      
    5945     mDisplayWaitStatusText me, "Saving movie..." 
    5946      
    5947     saveMovie() 
    5948      
    5949     mExportAllScriptsToDiskWithFolder me, 1, selected_Members_Only, 1, workingFolder 
    5950      
    5951     castlibList = 0 
    5952      
    5953   end if 
    5954    
    5955    
    5956    
    5957   if castlibList = 0 then 
    5958      
    5959     -------- if we work on only one castlib: 
    5960     if length(clibfolder) > 0 then workingFolder = clibfolder 
    5961     -------- 
    5962      
    5963      
    5964     if the platform contains "mac" then 
    5965       svnBinary = baUnixName(svnBinary) 
    5966       workingFolder = baUnixName(workingFolder) 
    5967     else 
    5968       if the last char of workingFolder = the last char of the applicationpath then delete the last char of workingFolder 
    5969     end if 
    5970      
    5971      
    5972     workingFolder = " " & QUOTE & workingFolder & QUOTE 
    5973      
    5974   else 
    5975      
    5976     if the platform contains "mac" then svnBinary = baUnixName(svnBinary) 
    5977     cnt = count(castlibList) 
    5978      
    5979     workingFolder = "" 
    5980      
    5981     repeat with n = 1 to cnt 
    5982        
    5983       if the platform contains "mac" then 
    5984         castlibList[n][3] = baUnixName(castlibList[n][3]) 
    5985       else 
    5986         str = castlibList[n][3] 
    5987         if the last char of str = the last char of the applicationpath then 
    5988           delete the last char of str 
    5989           castlibList[n][3] = str 
    5990         end if 
    5991       end if 
    5992        
    5993       put " " & QUOTE & castlibList[n][3] & QUOTE after workingFolder 
    5994        
    5995     end repeat 
    5996      
    5997   end if 
    5998    
    5999    
    6000   mDisplayWaitStatusText me, "SVN update of:" && workingFolder 
    6001    
    6002    
    6003   theresult = shell_cmd_list(svnBinary && "update" & workingFolder) 
    6004    
    6005    
    6006   if count(theresult) < 1 then 
    6007     theresult = shell_cmd_list(svnBinary && "update" & workingFolder && "2>&1") 
    6008     if count(theresult) < 1 then 
    6009       theError = theresult[1] 
    6010     else 
    6011       theError = "svn did not respond at all." 
    6012     end if 
    6013     alert "Can't proceed svn error while trying to update:" && theError 
    6014     if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    6015     return 0   
    6016   end if 
    6017    
    6018   theresult = shell_cmd_list(svnBinary && "status" & workingFolder) 
    6019    
    6020   cnt = count(theresult) 
    6021   if cnt < 1 then 
    6022     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 0 
    6025   end if 
    6026    
    6027   repeat with n = 1 to cnt 
    6028     answ = theresult[n] 
    6029     meth = word 1 of answ 
    6030     delete word 1 of answ 
    6031      
    6032     case meth of 
    6033       "!": -- 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 case 
    6035         -- as it may also be the case, that we only have a subset of the castlibs/scripts 
    6036         -- therefore I just skip these files and leave it to the user what to do with them in his svn client application 
    6037         -- we only put a message, so the user is made aware of this fact 
    6038         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 file 
    6044         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:" && answ 
    6053          
    6054         mDisplayWaitStatusText me, "Update file:" && answ 
    6055          
    6056     end case 
    6057      
    6058   end repeat 
    6059    
    6060   mDisplayWaitStatusText me, "SVN commit:" && workingFolder 
    6061    
    6062   theresult = shell_cmd_list(svnBinary && "ci --message" && QUOTE & msg & QUOTE & workingFolder) 
    6063    
    6064    
    6065   if count(theresult) > 0 then 
    6066     theResult = theresult[1] 
    6067      
    6068     put theResult 
    6069      
    6070      
    6071     if dontShowAlert <> 1 then 
    6072       alert "Done, see the results of the svn operation in the message window." 
    6073     end if 
    6074      
    6075   else 
    6076     alert "svn application did not respond, something seems to have failed, while commiting the scripttext. :-(" 
    6077   end if 
    6078    
    6079    
    6080   setPref("svn_workingCopies_paths.txt", string(workingCopies)) 
    6081    
    6082    
    6083   if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    6084    
    6085   return 1 
    6086    
    6087 end 
    6088  
    6089  
    6090  
    6091 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    6092 ---------- svn helper handlers 
    6093  
    6094 on mGetSVNBinaryPath me, workingCopies 
    6095    
    6096   if (mCheckForXtra(me, "budapi") + mCheckForXtra(me, "shell")) < 2 then 
    6097     alert "You need the shell xtra and the buddyApi xtra in order to proceed" 
    6098     return "" 
    6099   end if 
    6100    
    6101   savePrefs = 0 
    6102   if ilk(workingCopies) <> #proplist then 
    6103     workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
    6104     if ilk(workingCopies) <> #proplist then workingCopies = [:] 
    6105     savePrefs = 1 
    6106   end if 
    6107    
    6108    
    6109   if the platform contains "mac" then 
    6110     svnBinary = baHFSName(string(workingCopies.getaprop(#svnBinary))) 
    6111   else 
    6112     svnBinary = string(workingCopies.getaprop(#svnBinary)) 
    6113   end if 
    6114    
    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 then 
    6121        
    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 if 
    6126        
    6127       if count(svnBinary) < 1 then 
    6128         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       else 
    6133         svnBinary = baHFSName(svnBinary[1]) 
    6134          
    6135       end if 
    6136        
    6137        
    6138     end if 
    6139      
    6140     if baFileExists(svnBinary) <> 1 then 
    6141       alert "The path to the svn binary seems to have changed. Please try again in order to search the path." 
    6142       svnBinary = "" 
    6143     end if 
    6144      
    6145      
    6146   else 
    6147     -- dunno how to check on windows, if svn is installed, anyone ? 
    6148     svnBinary = "svn" 
    6149   end if 
    6150    
    6151    
    6152   workingCopies.setaprop(#svnBinary, svnBinary) 
    6153    
    6154   if savePrefs = 1 then setPref("svn_workingCopies_paths.txt", string(workingCopies)) 
    6155    
    6156   return svnBinary 
    6157    
    6158 end 
    6159  
    6160 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    6161  
    6162 on mGetWorkingCopyPath me, movieIdentifier, chooseNewPath, workingCopies, selectMsg 
    6163    
    6164   movieIdentifier = string(movieIdentifier) 
    6165   if length(movieIdentifier) < 1 then 
    6166     movieIdentifier = the moviepath & the moviename 
    6167   end if 
    6168    
    6169   savePrefs = 0 
    6170   if ilk(workingCopies) <> #proplist then 
    6171     workingCopies = value(getPref("svn_workingCopies_paths.txt")) 
    6172     if ilk(workingCopies) <> #proplist then workingCopies = [:] 
    6173     savePrefs = 1 
    6174   end if 
    6175    
    6176   workingFolder = string(workingCopies.getaprop(movieIdentifier)) 
    6177    
    6178   if length(workingFolder) > 0 then 
    6179     if baFolderExists(workingFolder) <> 1 then 
    6180       workingFolder = "" 
    6181     end if 
    6182   end if 
    6183    
    6184    
    6185   if chooseNewPath = 1 then 
    6186     workingFolder = baGetFolder(the moviepath, "Please select a working copy for SVN update", 3, "Select working copy", -2, -2) 
    6187   end if 
    6188    
    6189   if workingFolder = "" then 
    6190      
    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 selectMsg 
    6195      
    6196     workingFolder = baGetFolder(the moviepath, "Please select a working copy for SVN update", 3, "Select working copy", -2, -2) 
    6197   end if 
    6198    
    6199   if length(workingFolder) < 1 then return "" 
    6200    
    6201   delim = the last char of the applicationpath 
    6202   if the last char of workingFolder <> delim then put delim after workingFolder 
    6203    
    6204   if baFolderExists(workingFolder & ".svn") <> 1 then 
    6205      
    6206     alert workingFolder && "does not appear to be a svn working copy." 
    6207      
    6208     workingCopies.deleteprop(movieIdentifier) 
    6209      
    6210     return "" 
    6211   end if 
    6212    
    6213   workingCopies.setaprop(movieIdentifier, workingFolder) 
    6214    
    6215   if savePrefs = 1 then setPref("svn_workingCopies_paths.txt", string(workingCopies)) 
    6216    
    6217   return workingFolder 
    6218    
    6219 end 
    6220  
    6221  
    6222  
    6223 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    62242253on _______________GLOSSARY_ITEMS me 
    62252254end 
    62262255-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    62272256 
    6228  
    6229  
    6230 -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    62312257 
    62322258on pasteDate me 
  • trunk/lingosource/castlib1/convert_Lingo_2_CSS_Html.ls

    r63 r74  
    2222    sel = the selection of castlib cl 
    2323    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." 
    2525      exit 
    2626    end if 
    2727    memref = member(sel[1][1], cl) 
    2828    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." 
    3030      exit 
    3131    end if 
  • trunk/lingosource/castlib1/memberInfo.xml

    r63 r74  
    55                <comments></comments> 
    66                <memberName>thisMoviesScript</memberName> 
    7                 <fName>thisMoviesScript</fName> 
     7                <fname>thisMoviesScript</fname> 
    88        </thisMoviesScript> 
    99        <keyboardNavigation_FrameLoop> 
     
    1111                <comments></comments> 
    1212                <memberName>keyboardNavigation_FrameLoop</memberName> 
    13                 <fName>keyboardNavigation_FrameLoop</fName> 
     13                <fname>keyboardNavigation_FrameLoop</fname> 
    1414        </keyboardNavigation_FrameLoop> 
    1515        <menu1_button> 
     
    1717                <comments></comments> 
    1818                <memberName>menu1_button</memberName> 
    19                 <fName>menu1_button</fName> 
     19                <fname>menu1_button</fname> 
    2020        </menu1_button> 
    2121        <menu2_button> 
     
    2323                <comments></comments> 
    2424                <memberName>menu2_button</memberName> 
    25                 <fName>menu2_button</fName> 
     25                <fname>menu2_button</fname> 
    2626        </menu2_button> 
    2727        <simpleBMMenu> 
     
    2929                <comments></comments> 
    3030                <memberName>simpleBMMenu</memberName> 
    31                 <fName>simpleBMMenu</fName> 
     31                <fname>simpleBMMenu</fname> 
    3232        </simpleBMMenu> 
    3333        <OSCmenu_Utilities> 
     
    3535                <comments></comments> 
    3636                <memberName>OSCmenu_Utilities</memberName> 
    37                 <fName>OSCmenu_Utilities</fName> 
     37                <fname>OSCmenu_Utilities</fname> 
    3838        </OSCmenu_Utilities> 
    3939        <alexUtilities> 
     
    4141                <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 
    4242                <memberName>alexUtilities</memberName> 
    43                 <fName>alexUtilities</fName> 
     43                <fname>alexUtilities</fname> 
    4444        </alexUtilities> 
    4545        <convert_Lingo_2_CSS_Html> 
     
    4747                <comments>~/Documents/Scripts/lingo/convert_Lingo_2_CSS_Html.ls</comments> 
    4848                <memberName>convert_Lingo_2_CSS_Html</memberName> 
    49                 <fName>convert_Lingo_2_CSS_Html</fName> 
     49                <fname>convert_Lingo_2_CSS_Html</fname> 
    5050        </convert_Lingo_2_CSS_Html> 
    5151        <OSCmenu_Handlers> 
     
    5353                <comments></comments> 
    5454                <memberName>OSCmenu_Handlers</memberName> 
    55                 <fName>OSCmenu_Handlers</fName> 
     55                <fname>OSCmenu_Handlers</fname> 
    5656        </OSCmenu_Handlers> 
    5757        <pastefeld> 
     
    5959                <comments></comments> 
    6060                <memberName>pastefeld</memberName> 
    61                 <fName>pastefeld</fName> 
     61                <fname>pastefeld</fname> 
    6262        </pastefeld> 
    6363        <oldclipboard> 
     
    6565                <comments></comments> 
    6666                <memberName>oldclipboard</memberName> 
    67                 <fName>oldclipboard</fName> 
     67                <fname>oldclipboard</fname> 
    6868        </oldclipboard> 
    6969        <searchword> 
     
    7171                <comments></comments> 
    7272                <memberName>searchword</memberName> 
    73                 <fName>searchword</fName> 
     73                <fname>searchword</fname> 
    7474        </searchword> 
    7575        <resizewindowfs> 
     
    7777                <comments></comments> 
    7878                <memberName>resizewindowfs</memberName> 
    79                 <fName>resizewindowfs</fName> 
     79                <fname>resizewindowfs</fname> 
    8080        </resizewindowfs> 
    8181        <showHideHelp> 
     
    8383                <comments></comments> 
    8484                <memberName>showHideHelp</memberName> 
    85                 <fName>showHideHelp</fName> 
     85                <fname>showHideHelp</fname> 
    8686        </showHideHelp> 
    8787        <helptext> 
     
    9292rtf</comments> 
    9393                <memberName>helptext</memberName> 
    94                 <fName>helptext</fName> 
     94                <fname>helptext</fname> 
    9595        </helptext> 
    9696        <texthyperlinkBehavior> 
     
    9898                <comments>/Users/alex/Documents/ALIEN/myLinkedScripts/texthyperlinkBehavior.ls</comments> 
    9999                <memberName>texthyperlinkBehavior</memberName> 
    100                 <fName>texthyperlinkBehavior</fName> 
     100                <fname>texthyperlinkBehavior</fname> 
    101101        </texthyperlinkBehavior> 
    102102        <bbdiff> 
     
    104104                <comments></comments> 
    105105                <memberName>bbdiff</memberName> 
    106                 <fName>bbdiff</fName> 
     106                <fname>bbdiff</fname> 
    107107        </bbdiff> 
    108108        <statusOutput> 
     
    113113rtf</comments> 
    114114                <memberName>statusOutput</memberName> 
    115                 <fName>statusOutput</fName> 
     115                <fname>statusOutput</fname> 
    116116        </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> 
    117129</Untitled> 
  • trunk/lingosource/castlib2/FileIOFunktionen.ls

    r37 r74  
    106106      if call(#mCheckForXtra, mGetXScript(), "BudAPI") = 1 then 
    107107        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 
    108116        if length(startfolder) > 0 then 
    109117          pfad = baGetFilename("save", startfolder, theDefaultName, "", 524288+2+4+4194304, theTitle, false, -1, -1) 
     
    111119        pfad = baGetFilename("save", "", theDefaultName, "", 524288+2+4+4194304, theTitle, false, -1, -1) 
    112120        end if 
     121         
     122        if resetUNames = 1 then baReturnUnixNames(1) 
     123         
    113124      else 
    114125        pfad = fio.displaySave(theTitle, theDefaultName) 
     
    275286  if call(#mCheckForXtra, mGetXScript(), "BudAPI") = 1 then 
    276287     
     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     
    277296    startDir = string(startDir) 
    278297    defaultName = string(defaultName) 
     
    281300    prompt = string(prompt) 
    282301     
    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 
    284307     
    285308  else 
     
    307330   
    308331  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     
    309341    retval = baGetFolder( "", "Select a folder", 3, "", 50, 50 ) 
     342     
     343    if resetUNames = 1 then baReturnUnixNames(1) 
     344     
    310345  else if xscr().mCheckForXtra("FileXtra4") = 1 then -- if not buddy then try filextra 
    311346    fx = (xtra "filextra4").new() 
     
    340375   
    341376  if xscr().mCheckForXtra("BudAPI") then -- if buddy is present... 
     377     
    342378    --  -- budApi version: 
    343379    retval = baFileList(folderpath, "*.*") 
  • trunk/lingosource/castlib2/GetSetPrefs.ls

    r63 r74  
    8585        thePrefs = "" 
    8686      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         
    8796        prefspath = baSysFolder("prefs") 
     97         
     98        if resetUNames = 1 then baReturnUnixNames(1) 
     99         
    88100        thePath = prefspath & prefsname 
    89101        fio.openfile(thePath, 1) 
     
    249261      if objectP(fio) then 
    250262         
     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         
    251271        prefpfad = baSysFolder("prefs")&prefsname 
     272         
     273        if resetUNames = 1 then baReturnUnixNames(1) 
    252274         
    253275        fio.openfile(prefpfad, 1) 
  • trunk/lingosource/castlib2/PseudoXMLPS.ls

    r63 r74  
    121121 
    122122-- Example: 
    123 -- saveString = mGetXMLStringFromList(lingo_list, "documentName") 
     123-- saveString = mGetXMLStringFromList(me, lingo_list, "documentName") 
    124124 
    125125on mGetXMLStringFromList me, listref, docName, strict, dontReplaceGT, withParams 
     
    157157 
    158158-- Example: 
    159 -- lingo_list = mGetListFromXMLString(saveString) 
     159-- lingo_list = mGetListFromXMLString(me, saveString) 
    160160 
    161161on mGetListFromXMLString me, str, convertValues, withParams 
     
    993993                         
    994994                      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") 
    996996                      end if -- if ilk(thisCell) = #proplist then 
    997997                       
     
    999999                     
    10001000                  else 
    1001                     xscr().mPut("mParseExcelXML: Row "&n&" is not a list") 
     1001                    call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Row "&n&" is not a list") 
    10021002                  end if -- if listP(currRow) then 
    10031003                   
     
    10051005                 
    10061006              else 
    1007                 xscr().mPut("mParseExcelXML: Table not found") 
     1007                call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Table not found") 
    10081008              end if -- if listP(xmlList) then 
    10091009               
    10101010            else 
    1011               xscr().mPut("mParseExcelXML: Worksheet not found") 
     1011              call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Worksheet not found") 
    10121012            end if -- if ilk(xmlList) = #proplist then 
    10131013             
    10141014          else 
    1015             xscr().mPut("mParseExcelXML: Workbook not found") 
     1015            call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Workbook not found") 
    10161016          end if -- if ilk(xmlList) = #proplist then 
    10171017           
    10181018        else 
    1019           xscr().mPut("mParseExcelXML: ROOT is not a property list") 
     1019          call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: ROOT is not a property list") 
    10201020        end if --if ilk(xmlList) = #proplist then 
    10211021         
    10221022      else 
    1023         xscr().mPut("mParseExcelXML: Xml parser makelist() returned empty list") 
     1023        call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Xml parser makelist() returned empty list") 
    10241024      end if -- if count(xmlList) > 0 then 
    10251025       
    10261026    else 
    1027       xscr().mPut("mParseExcelXML: Xml parser makelist() failed") 
     1027      call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Xml parser makelist() failed") 
    10281028    end if -- if listP(xmlList) then 
    10291029     
    10301030  else 
    1031     xscr().mPut("mParseExcelXML: Xml parser error: "&xmlp.getError()) 
     1031    call(#mPut, [mGetXScript(#commonmoviescript)], "mParseExcelXML: Xml parser error: "&xmlp.getError()) 
    10321032  end if -- if voidP(xmlp.getError()) then 
    10331033   
     
    12341234  else 
    12351235    pregex_translate(strli, li[1], li[2]) 
     1236     
    12361237  end if 
    12371238   
  • trunk/lingosource/castlib2/commonMovieScript.ls

    r63 r74  
    319319   
    320320  theGlobs = mGetGlobalList(me) 
    321   if theGlobs.getaprop(#gCustomKeyHandling) = 1 then return mProcessKeyDownEvent() 
     321  if theGlobs.getaprop(#gCustomKeyHandling) = 1 then return mProcessKeyDownEvent(tk, kc) 
    322322   
    323323  retval = 0 
     
    16991699 
    17001700-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1701 
     1702on 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 
     1723end 
     1724 
     1725 
     1726-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    17011727on ____________CONVERT_CASE 
    17021728end 
     
    17841810    "it": 
    17851811      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"] 
    17861816    otherwise: 
    1787       li = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"] 
     1817      return vN 
    17881818  end case 
    17891819  return li.getAt(vN) 
  • trunk/lingosource/castlib2/memberInfo.xml

    r49 r74  
    55                <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 
    66                <memberName>commonMovieScript</memberName> 
    7                 <fName>commonMovieScript</fName> 
     7                <fname>commonMovieScript</fname> 
    88        </commonmoviescript> 
    99        <FileIOFunktionen> 
     
    1111                <comments>~/Documents/Scripts/lingo/FileIOFunktionen.ls</comments> 
    1212                <memberName>FileIOFunktionen</memberName> 
    13                 <fName>FileIOFunktionen</fName> 
     13                <fname>FileIOFunktionen</fname> 
    1414        </FileIOFunktionen> 
    1515        <GetSetPrefs> 
     
    1717                <comments>~/Documents/Scripts/lingo/GetSetPrefs.ls</comments> 
    1818                <memberName>GetSetPrefs</memberName> 
    19                 <fName>GetSetPrefs</fName> 
     19                <fname>GetSetPrefs</fname> 
    2020        </GetSetPrefs> 
    2121        <aleXtrasMovieScript> 
     
    2323                <comments>~/Documents/Scripts/lingo/aleXtrasMovieScript.ls</comments> 
    2424                <memberName>aleXtrasMovieScript</memberName> 
    25                 <fName>aleXtrasMovieScript</fName> 
     25                <fname>aleXtrasMovieScript</fname> 
    2626        </aleXtrasMovieScript> 
    2727        <PseudoXMLPS> 
     
    2929                <comments>~/Documents/Scripts/lingo/PseudoXMLPS.ls</comments> 
    3030                <memberName>PseudoXMLPS</memberName> 
    31                 <fName>PseudoXMLPS</fName> 
     31                <fname>PseudoXMLPS</fname> 
    3232        </PseudoXMLPS> 
    3333        <simpleGoToAction> 
     
    3535                <comments>/Users/alex/Documents/ALIEN/myLinkedScripts/simpleGoToAction.ls</comments> 
    3636                <memberName>simpleGoToAction</memberName> 
    37                 <fName>simpleGoToAction</fName> 
     37                <fname>simpleGoToAction</fname> 
    3838        </simpleGoToAction> 
    3939        <SpriteNameBeaver> 
     
    4141                <comments>~/Documents/Scripts/lingo/SpriteNameBeaver.ls</comments> 
    4242                <memberName>SpriteNameBeaver</memberName> 
    43                 <fName>SpriteNameBeaver</fName> 
     43                <fname>SpriteNameBeaver</fname> 
    4444        </SpriteNameBeaver> 
    4545</Untitled> 
Note: See TracChangeset for help on using the changeset viewer.