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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.