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

Changeset 153 for trunk/lingosource


Ignore:
Timestamp:
02/21/08 07:51:08 (4 years ago)
Author:
alex
Message:

added functions for lingodoc snippets and fixed issues with external script editors on mac

Location:
trunk/lingosource
Files:
5 edited

Legend:

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

    r148 r153  
    2626  subli.add("Insert divider") 
    2727  pLookUpCommandList.setaprop("Insert divider", ["pasteDivider me", "alexUtilities"]) 
     28   
     29  subli.add("Insert lingodoc script abstract") 
     30  pLookUpCommandList.setaprop("Insert script abstract", ["snipAbstract me", "alexUtilities"]) 
     31   
     32  subli.add("Insert lingodoc handler description") 
     33  pLookUpCommandList.setaprop("Insert divider", ["snipTitle me", "alexUtilities"]) 
    2834   
    2935  li.add("") 
  • trunk/lingosource/castlib1/alexUtilities.ls

    r151 r153  
    25322532 
    25332533 
     2534on snipTitle me 
     2535  str = "-----------------------------------\ 
     2536  -- CREATED: <currentDate>\ 
     2537  -- ACTION: Description\ 
     2538  -- INPUT: -\ 
     2539  -- RETURNS: -\ 
     2540  -- CALLER: -\ 
     2541  -- DEBUG: -\ 
     2542  -- TODO: -\ 
     2543-----------------------------------" 
     2544  pasteFieldContent str, 1 
     2545end 
     2546 
     2547-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     2548 
     2549on snipAbstract me 
     2550  str = "-- <Scriptname>\ 
     2551-----------------------------------\ 
     2552-- CREATED:\ 
     2553-- <currentDate>\ 
     2554--\ 
     2555-- DESCRIPTION:\ 
     2556-- -\ 
     2557--\ 
     2558-- REQUIRES:\ 
     2559-- (Prerequisites)\ 
     2560--\ 
     2561-- USAGE:\ 
     2562-- -\ 
     2563--\ 
     2564-- PARAMS:\ 
     2565-- -\ 
     2566--\ 
     2567-- RETURNS:\ 
     2568-- -\ 
     2569--\ 
     2570-- WARNINGS:\ 
     2571-- -\ 
     2572--\ 
     2573-- TODO:\ 
     2574-- -\ 
     2575-----------------------------------" 
     2576  pasteFieldContent str, 1 
     2577end 
     2578 
     2579-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     2580 
     2581on pasteFieldContent whichFieldname, replacePlaceHolder 
     2582  m = member(whichFieldname) 
     2583  if ilk(m) <> #member then exit 
     2584  if [#field, #text].getPos(m.type) > 0 then mPasteItem m.text, replacePlaceHolder 
     2585end 
     2586 
     2587-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     2588 
    25342589on pasteDate me 
    25352590   
     
    25512606-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    25522607 
    2553 on mPasteItem me, theText 
    2554    
    2555   pastefield = new(#field) 
    2556   pastefield.text = theText 
    2557    
    2558   oldclipboard = new(#field) 
    2559   oldclipboard.pasteClipBoardInto() 
    2560    
    2561   pastefield.copyToClipBoard() 
     2608on mPasteItem me, theText, replacePlaceHolder 
    25622609   
    25632610   
     
    25802627  end if 
    25812628   
     2629   
     2630    if ilk(theMem) = #member then 
     2631    if theMem.type = #script then 
     2632       
     2633      --------------------------------- we paste the placeholder only here in this script, because there is a placeholder 
     2634      --------------------------------- for the current scriptname, which we only "know" here in this script 
     2635      if replacePlaceHolder = 1 then 
     2636        placeholders = [["<currentDate>", the short date], ["<scriptname>", theMem.name]] 
     2637         
     2638          repeat with repl in placeholders 
     2639            if repl[1] <> repl[2] then 
     2640            offs = offset(repl[1], theText) 
     2641            repeat while offs > 0 
     2642              put repl[2] into char offs to offs + length(repl[1]) - 1 of theText 
     2643              offs = offset(repl[1], theText) 
     2644            end repeat 
     2645            end if 
     2646          end repeat 
     2647         
     2648      end if 
     2649      --------------------------------- 
     2650       
     2651    end if 
     2652  end if 
     2653   
     2654  pastefield = new(#field) 
     2655  pastefield.text = theText 
     2656   
     2657  oldclipboard = new(#field) 
     2658  oldclipboard.pasteClipBoardInto() 
     2659   
     2660  pastefield.copyToClipBoard() 
     2661   
     2662   
    25822663  if ilk(theMem) = #member then 
    25832664    if theMem.type = #script then 
  • trunk/lingosource/castlib1/bbedit_Utilities.ls

    r151 r153  
    147147           
    148148          theResult = mSaveTextToTempFile(me, theText, tempSrcHFSPath) 
    149           --------------------- 
    150            
    151           mDoShellCmd(me, "bbedit " & tempSrcPath) 
     149           
     150          if theResult = 0 then 
     151            alert "Unable to save temp file:" && tempSrcHFSPath 
     152          else 
     153            mDoShellCmd(me, "bbedit " & tempSrcPath) 
     154          end if 
     155           
    152156           
    153157        end if 
     
    206210  sel = the selection of castlib cl 
    207211   
    208   if mCheckForXtra(me, "BudAPI") then 
    209     --    tempFolder = basysfolder("temp") 
    210      
    211     if the platform contains "mac" then 
    212        
    213       isMac = 1 
    214       resetUNames = 0 
    215       if baSysFolder("prefs") starts "/" then 
    216         baReturnUnixNames(0) 
    217         resetUNames = 1 
    218       end if 
    219       tempFolderHFS = basysfolder("temp") 
    220       baReturnUnixNames(1) 
    221       tempFolder = basysfolder("temp") 
    222       if resetUNames = 0 then 
    223         baReturnUnixNames(0) 
    224       end if 
    225        
    226     else 
    227       tempFolderHFS = basysfolder("temp") 
    228       tempFolder = tempFolderHFS 
    229     end if 
    230      
    231      
    232   else 
    233     alert "You need the buddyApi xtra for this operation" 
    234     exit 
    235   end if 
     212  isMac = (the platform contains "mac") 
    236213   
    237214  editor = mGetExternalScriptEditor(me) 
     
    258235        if doLiveEdit then 
    259236          --------------------- 
    260           tempSrcPath = tempFolder & "temp_LingoScript_file.ls" 
     237          tempSrcHFSPath = mGetTempFilePath(me, "temp_LingoScript_file.ls") 
    261238           
    262239          if isMac then 
    263240            waitparam = "" 
    264241            editor = mGetMacBinary(me, editor) 
    265             tempSrcHFSPath = mConvertUnix2Hfs(me, tempSrcPath) 
     242            tempSrcPath = mConvertHfs2Unix(me, tempSrcHFSPath) 
    266243          else 
    267             waitparam = " \w" 
    268             tempSrcHFSPath = tempSrcPath 
     244            waitparam = " /wait" 
     245            tempSrcPath = tempSrcHFSPath 
    269246          end if 
    270247          --------------------- 
     
    272249          theResult = mSaveTextToTempFile(me, theText, tempSrcHFSPath) 
    273250           
    274           mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 
    275            
    276           theText = mGetTextFromFile(me, tempSrcHFSPath) 
    277            
    278           theText = mForceMacLineBreaks(me, theText) 
    279            
    280           if theType = #script then 
    281             memref.scripttext = theText 
    282           else if theType = #text then 
    283             memref.html = theText 
    284           else if theType = #field then 
    285             memref.text = theText 
     251          if theResult = 0 then 
     252            alert "Unable to save temp file:" && tempSrcHFSPath 
     253          else 
     254             
     255            mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 
     256             
     257            theText = mGetTextFromFile(me, tempSrcHFSPath) 
     258             
     259            if length(theText) < 1 then 
     260              alert "Temp file:" && tempSrcHFSPath && "contains no text. Changes will not be written to script." 
     261               
     262            else 
     263               
     264              theText = mForceMacLineBreaks(me, theText) 
     265               
     266              if theType = #script then 
     267                memref.scripttext = theText 
     268              else if theType = #text then 
     269                memref.html = theText 
     270              else if theType = #field then 
     271                memref.text = theText 
     272              end if 
     273               
     274            end if 
     275             
    286276          end if 
    287277           
     
    295285          --------------------- 
    296286          -- create a temporary file from scripttext: 
    297           tempSrcPath = tempFolder & theName & ".ls" 
     287          tempSrcHFSPath = mGetTempFilePath(me, theName & ".ls") 
    298288           
    299289          if isMac then 
    300290            waitparam = " &" 
    301             editor = "" 
    302             tempSrcHFSPath = tempSrcPath 
     291            editor = mGetMacBinary(me, editor) 
     292            tempSrcPath = tempSrcHFSPath 
    303293          else 
    304294            waitparam = "" 
    305             tempSrcHFSPath = tempSrcPath 
     295            tempSrcPath = tempSrcHFSPath 
    306296          end if 
    307297           
     
    309299          --------------------- 
    310300           
    311           mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 
     301          if theResult = 0 then 
     302            alert "Unable to save temp file:" && tempSrcHFSPath 
     303          else 
     304            mDoShellCmd(me, QUOTE & editor & QUOTE && tempSrcPath & waitparam) 
     305          end if 
    312306           
    313307        end if 
     
    355349          #field: memref.text = theText 
    356350        end case 
     351         
     352      else 
     353        alert "Temp file:" && tempSrcPath && "contains no text. Changes will not be written to script." 
    357354         
    358355      end if 
  • trunk/lingosource/castlib1/memberInfo.xml

    r150 r153  
    55                <comments></comments> 
    66                <memberName>doCommandMovieScript</memberName> 
    7                 <fname>doCommandMovieScript</fname> 
     7                <fName>doCommandMovieScript</fName> 
    88        </doCommandMovieScript> 
    99        <thisMoviesScript> 
     
    1111                <comments></comments> 
    1212                <memberName>thisMoviesScript</memberName> 
    13                 <fname>thisMoviesScript</fname> 
     13                <fName>thisMoviesScript</fName> 
    1414        </thisMoviesScript> 
    1515        <keyboardNavigation_FrameLoop> 
     
    1717                <comments></comments> 
    1818                <memberName>keyboardNavigation_FrameLoop</memberName> 
    19                 <fname>keyboardNavigation_FrameLoop</fname> 
     19                <fName>keyboardNavigation_FrameLoop</fName> 
    2020        </keyboardNavigation_FrameLoop> 
    2121        <menu1_button> 
     
    2323                <comments></comments> 
    2424                <memberName>menu1_button</memberName> 
    25                 <fname>menu1_button</fname> 
     25                <fName>menu1_button</fName> 
    2626        </menu1_button> 
    2727        <menu2_button> 
     
    2929                <comments></comments> 
    3030                <memberName>menu2_button</memberName> 
    31                 <fname>menu2_button</fname> 
     31                <fName>menu2_button</fName> 
    3232        </menu2_button> 
    3333        <simpleBMMenu> 
     
    3535                <comments></comments> 
    3636                <memberName>simpleBMMenu</memberName> 
    37                 <fname>simpleBMMenu</fname> 
     37                <fName>simpleBMMenu</fName> 
    3838        </simpleBMMenu> 
    3939        <OSCmenu_Utilities> 
     
    4141                <comments></comments> 
    4242                <memberName>OSCmenu_Utilities</memberName> 
    43                 <fname>OSCmenu_Utilities</fname> 
     43                <fName>OSCmenu_Utilities</fName> 
    4444        </OSCmenu_Utilities> 
    4545        <alexUtilities> 
     
    4747                <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 
    4848                <memberName>alexUtilities</memberName> 
    49                 <fname>alexUtilities</fname> 
     49                <fName>alexUtilities</fName> 
    5050        </alexUtilities> 
    5151        <convert_Lingo_2_CSS_Html> 
     
    5353                <comments>~/Documents/Scripts/lingo/convert_Lingo_2_CSS_Html.ls</comments> 
    5454                <memberName>convert_Lingo_2_CSS_Html</memberName> 
    55                 <fname>convert_Lingo_2_CSS_Html</fname> 
     55                <fName>convert_Lingo_2_CSS_Html</fName> 
    5656        </convert_Lingo_2_CSS_Html> 
    5757        <OSCmenu_Handlers> 
     
    5959                <comments></comments> 
    6060                <memberName>OSCmenu_Handlers</memberName> 
    61                 <fname>OSCmenu_Handlers</fname> 
     61                <fName>OSCmenu_Handlers</fName> 
    6262        </OSCmenu_Handlers> 
    6363        <pastefeld> 
     
    6565                <comments></comments> 
    6666                <memberName>pastefeld</memberName> 
    67                 <fname>pastefeld</fname> 
     67                <fName>pastefeld</fName> 
    6868        </pastefeld> 
    6969        <oldclipboard> 
     
    7171                <comments></comments> 
    7272                <memberName>oldclipboard</memberName> 
    73                 <fname>oldclipboard</fname> 
     73                <fName>oldclipboard</fName> 
    7474        </oldclipboard> 
    7575        <searchword> 
     
    7777                <comments></comments> 
    7878                <memberName>searchword</memberName> 
    79                 <fname>searchword</fname> 
     79                <fName>searchword</fName> 
    8080        </searchword> 
    8181        <resizewindowfs> 
     
    8383                <comments></comments> 
    8484                <memberName>resizewindowfs</memberName> 
    85                 <fname>resizewindowfs</fname> 
     85                <fName>resizewindowfs</fName> 
    8686        </resizewindowfs> 
    8787        <showHideHelp> 
     
    8989                <comments></comments> 
    9090                <memberName>showHideHelp</memberName> 
    91                 <fname>showHideHelp</fname> 
     91                <fName>showHideHelp</fName> 
    9292        </showHideHelp> 
    9393        <helptext> 
     
    9898rtf</comments> 
    9999                <memberName>helptext</memberName> 
    100                 <fname>helptext</fname> 
     100                <fName>helptext</fName> 
    101101        </helptext> 
    102102        <texthyperlinkBehavior> 
     
    104104                <comments>/Users/alex/Documents/ALIEN/myLinkedScripts/texthyperlinkBehavior.ls</comments> 
    105105                <memberName>texthyperlinkBehavior</memberName> 
    106                 <fname>texthyperlinkBehavior</fname> 
     106                <fName>texthyperlinkBehavior</fName> 
    107107        </texthyperlinkBehavior> 
    108108        <statusOutput> 
     
    113113rtf</comments> 
    114114                <memberName>statusOutput</memberName> 
    115                 <fname>statusOutput</fname> 
     115                <fName>statusOutput</fName> 
    116116        </statusOutput> 
    117117        <bbedit_Utilities> 
     
    119119                <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 
    120120                <memberName>bbedit_Utilities</memberName> 
    121                 <fname>bbedit_Utilities</fname> 
     121                <fName>bbedit_Utilities</fName> 
    122122        </bbedit_Utilities> 
    123123        <svn_Utilities> 
     
    125125                <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 
    126126                <memberName>svn_Utilities</memberName> 
    127                 <fname>svn_Utilities</fname> 
     127                <fName>svn_Utilities</fName> 
    128128        </svn_Utilities> 
    129129        <custom_Utilities> 
     
    131131                <comments>~/Documents/Scripts/lingo/commonMovieScript.ls</comments> 
    132132                <memberName>custom_Utilities</memberName> 
    133                 <fname>custom_Utilities</fname> 
     133                <fName>custom_Utilities</fName> 
    134134        </custom_Utilities> 
    135135</Untitled> 
  • trunk/lingosource/castlib2/memberInfo.xml

    r150 r153  
    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.