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

Ignore:
Timestamp:
03/20/09 18:08:22 (3 years ago)
Author:
alex
Message:

added handler to export only scripttext with metadata for the member and added new handler to svn quicklinks to update all castlibs

Location:
trunk/lingosource/castlib2
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/lingosource/castlib2/GetSetPrefs.ls

    r186 r228  
    179179--    delete line 1 of prefsText 
    180180     
    181     gPrefs = call(#mGetListFromXMLString, mGetXScript(#PseudoXMLPS), prefsText) 
     181    gPrefs = call(#mGetListFromXMLStringX, mGetXScript(#PseudoXMLPS), prefsText) 
    182182    if objectP(gPrefs) then globs[#gPrefs] = gPrefs 
    183183     
  • trunk/lingosource/castlib2/PseudoXMLPS.ls

    r215 r228  
    22----------------------------------- 
    33-- CREATED: 
    4 -- 06.03.2008 
     4-- 2002 
    55-- 
    66-- DESCRIPTION: 
    77--              Pseudo XML by Alex da Franca c2003 
    8 -- Convert a lingo list to a XML like string and back 
     8--              Convert a lingo list to a XML like string and back 
    99 
    1010-- 
    1111-- REQUIRES: 
    12 -- (Prerequisites) 
     12--              only the functions mSaveList_2_XML() and mReadXML_2_List() require my system of library scripts 
     13--              in order to write and read text with fileio. All other functions have no dependencies 
     14--              Either get these scripts from my website, or replace the write/read stuff with your own fileIO handlers 
     15--                    That is: 
     16--                            * movie script "aleXtrasMovieScript" 
     17--                            * parent script "commonMovieScript" 
     18--                            * parent script "FileIOFunktionen" 
    1319-- 
    1420-- USAGE: 
     21--              ---------- please see the comments for each handler for a how-to. 
     22--              ---------- nonetheless here are some fast start comments with the minimum amount of parameters 
     23--              PseudoXMLPS = new(script "PseudoXMLPS") 
     24--              -- Convert a list to an xml string: 
     25--              xmlString = PseudoXMLPS.mGetXMLStringFromList(["one", "two", [#prop: 3]]) 
     26--              lingolist = PseudoXMLPS.mGetListFromXMLStringX(xmlString) 
     27--              ---------- basically that's it 
     28-- 
     29--              ---------- another "hack" to be aware of is the following: 
     30--              ---------- linear lists get identified by having a nodename which starts with the exact string "item" 
     31--              ---------- so if an xml node like <item1>one</item1> is encountered, it is treated as linear list: ["one"] 
     32--              ---------- and NOT as [#item1:"one"] 
     33-- 
     34--              ---------- the mGetXMLStringFromList() function escapes the reserved xml chars <> and & and ' and " by default 
     35--              ---------- if for some reason you rather want to enclose the contents in a <![CDATA[ tag, use the dontReplaceGT flag. 
     36--------------------------------------------- EXAMPLE for <dontReplaceGT = 1> (dontReplaceGT means don't replace "greater than" btw...): 
     37-- 
    1538-- myList = [#stringWithInvalidChars:"A string with invalid chars like <> and & and ' and " & QUOTE] 
    1639-- myList[#stringWithInvalidChars] = "<![CDATA[" & myList[#stringWithInvalidChars] & "]]>" 
     
    2851--   end if 
    2952-- end repeat 
     53--------------------------------------------- please note, that the above example is ONLY needed, if you use dontReplaceGT = 1 !! 
    3054-- 
    3155-- HISTORY: 
     
    129153  -- ACTION: Convert lingo list (also nested lists) to XML stylish string 
    130154  -- INPUT:  
    131 -- <listref> format: property list or linear list 
    132 -- <docName> format: #string; optional. if omitted "Untitled" is used for the XML document name 
     155  --              <listref> format: property list or linear list 
     156  --              <docName> format: #string; optional. if omitted "Untitled" is used for the XML document name 
    133157  --              <strict>        => boolean; avoid spaces in tag names 
    134158  --              <dontReplaceGT> => boolean; dont replace < and > 
    135159  --              <withParams>    => boolean; write attribute in tag for the lingo ilk => bigger xml files and unfortunately it is slower to parse 
    136 ----------------------------- (I thought avoiding value() would help, but in this case the additional text parsing of the attributes tag slows down) 
     160  ----------------------------- (I thought avoiding value() would help, but in this case the additional text parsing of the attributes tag slows down) 
    137161  -- RETURNS: string 
    138162  -- EXAMPLE: saveString = mGetXMLStringFromList(me, lingo_list, "documentName") 
     
    173197  -- ACTION: Description 
    174198  -- INPUT: 
    175 -- <str> format: #string; split a string using <> and </> tags into lingo list 
    176 -- <convertValues> #integer 0=>don't convert (fast, all values are strings), 1 => convert only numbers (slower); 2 => try to convert all data, even colors (slow) 
     199  --          <str> format: #string; split a string using <> and </> tags into lingo list 
     200  --          <convertValues> #integer 0=>don't convert (fast, all values are strings), 1 => convert only numbers (slower); 2 => try to convert all data, even colors (slow) 
    177201  --          <withParams> : #boolean : parse parameters too. new, not very well tested 
    178202  -- RETURNS: property list 
     
    224248  --         BUT it must be a valid xml string, the above is slower but allows more malformed xml 
    225249  -- INPUT:  
    226 -- <str> format: #string; split a string using <> and </> tags into lingo list 
    227 -- <convertValues> #integer 
    228 -- -- -- 0 => don't convert (fast, all values are strings) 
    229 -- -- -- 1 => convert only integer() and float() (slower) 
    230 -- -- -- 2 => try to convert all data with value(), even parse for colors in hexstring format (slow) 
     250  --        <str> format: #string; split a string using <> and </> tags into lingo list 
     251  --        <convertValues> #integer 
     252  --          -- -- 0 => don't convert (fast, all values are strings) 
     253  --          -- -- 1 => convert only integer() and float() (slower) 
     254  --          -- -- 2 => try to convert all data with value(), even parse for colors in hexstring format (slow) 
    231255  -- RETURNS: property list 
    232256  -- EXAMPLE: lingo_list = mGetListFromXMLStringX(me, saveString) 
     
    306330  li = mConvertXMLPropList(me, [xx], convertValues, dontEscapeSpecialChars) 
    307331   
    308  -- put "x" && the milliseconds - ms 
     332  -- put "PseudoXMLPS: mGetListFromXMLStringX:" && the milliseconds - ms 
    309333   
    310334  if not(listP(li)) then return [:] 
     
    328352   
    329353  dertext = xscr(#FileIOFunktionen).mGetTextFromFile(thePath) 
    330   if length(dertext) > 0 then return xscr(#PseudoXMLPS).mGetListFromXMLStringX(dertext) 
     354  if length(dertext) > 0 then return mGetListFromXMLStringX(me, dertext) 
    331355  return [:] 
    332356end 
     
    345369   
    346370  if not(listP(theList)) then return 0 
    347   theResult = xscr(#PseudoXMLPS).mGetXMLStringFromList(theList) 
     371  theResult = mGetXMLStringFromList(me, theList) 
    348372  return xscr(#FileIOFunktionen).mSaveToTextFile(theResult, thePath) 
    349373end 
     
    757781   
    758782  if val.length = 7 then 
    759     if (val.char[1] = "#") and (offset(val.char[2], "abcdef0123456789") > 0) then return rgb(val) 
     783    if (val.char[1] = "#") then 
     784      isColor = 1 
     785      repeat with n = 2 to 7 
     786        if (offset(val.char[n], "abcdef0123456789") < 1) then 
     787          isColor = 0 
     788          exit repeat 
     789        end if 
     790      end repeat 
     791      if isColor = 1 then return rgb(val) 
     792    end if 
    760793  end if  
    761794   
     
    921954      if count(val) then 
    922955        if ilk(retlist) = #proplist then 
    923         retlist.addProp(symbol(inputlist[n].getaprop(#name)), mConvertXMLPropList(me, val, convertValues, dontEscapeSpecialChars)) 
    924       else 
     956          retlist.addProp(symbol(inputlist[n].getaprop(#name)), mConvertXMLPropList(me, val, convertValues, dontEscapeSpecialChars)) 
     957        else 
    925958          retlist.add(mConvertXMLPropList(me, val, convertValues, dontEscapeSpecialChars)) 
    926959        end if 
     
    943976               
    944977              -- unescape <>&'" 
    945                if dontEscapeSpecialChars <> 1 then val = mUnEscapeSpecialChars(me, val) 
     978              if dontEscapeSpecialChars <> 1 then val = mUnEscapeSpecialChars(me, val) 
    946979               
    947980            #integer: 
     
    9881021             
    9891022            -- unescape <>&'" 
    990            if dontEscapeSpecialChars <> 1 then val = mUnEscapeSpecialChars(me, val) 
     1023            if dontEscapeSpecialChars <> 1 then val = mUnEscapeSpecialChars(me, val) 
    9911024             
    9921025             
     
    10001033         
    10011034        if ilk(retlist) = #proplist then 
    1002         retlist.addProp(symbol(inputlist[n].getaprop(#name)), val) 
     1035          retlist.addProp(symbol(inputlist[n].getaprop(#name)), val) 
    10031036        else 
    10041037          retlist.add(val) 
     
    10221055  -- INPUT: <theText> ; string ; required => xml formatted string 
    10231056  -- RETURNS: property list 
    1024   -- EXAMPLE: plist = xscr(#PseudoXMLPS).mParseExcelXML(xscr(#FileIOFunktionen).mGetTextFromFile()) 
     1057  -- EXAMPLE: plist = new(script "PseudoXMLPS").mParseExcelXML(xscr(#FileIOFunktionen).mGetTextFromFile()) 
    10251058  ----------------------------------- 
    10261059   
     
    10611094                         
    10621095                      else 
    1063                         call(#mPut, mGetXScript(), "mParseExcelXML: Row "&n&" Cell "&m&" is not a property list") 
     1096                        put "mParseExcelXML: Row "&n&" Cell "&m&" is not a property list" 
    10641097                      end if -- if ilk(thisCell) = #proplist then 
    10651098                       
     
    10671100                     
    10681101                  else 
    1069                     call(#mPut, mGetXScript(), "mParseExcelXML: Row "&n&" is not a list") 
     1102                    put "mParseExcelXML: Row "&n&" is not a list" 
    10701103                  end if -- if listP(currRow) then 
    10711104                   
     
    10731106                 
    10741107              else 
    1075                 call(#mPut, mGetXScript(), "mParseExcelXML: Table not found") 
     1108                put "mParseExcelXML: Table not found" 
    10761109              end if -- if listP(xmlList) then 
    10771110               
    10781111            else 
    1079               call(#mPut, mGetXScript(), "mParseExcelXML: Worksheet not found") 
     1112              put "mParseExcelXML: Worksheet not found" 
    10801113            end if -- if ilk(xmlList) = #proplist then 
    10811114             
    10821115          else 
    1083             call(#mPut, mGetXScript(), "mParseExcelXML: Workbook not found") 
     1116            put "mParseExcelXML: Workbook not found" 
    10841117          end if -- if ilk(xmlList) = #proplist then 
    10851118           
    10861119        else 
    1087           call(#mPut, mGetXScript(), "mParseExcelXML: ROOT is not a property list") 
     1120          put "mParseExcelXML: ROOT is not a property list" 
    10881121        end if --if ilk(xmlList) = #proplist then 
    10891122         
    10901123      else 
    1091         call(#mPut, mGetXScript(), "mParseExcelXML: Xml parser makelist() returned empty list") 
     1124        put "mParseExcelXML: Xml parser makelist() returned empty list" 
    10921125      end if -- if count(xmlList) > 0 then 
    10931126       
    10941127    else 
    1095       call(#mPut, mGetXScript(), "mParseExcelXML: Xml parser makelist() failed") 
     1128      put "mParseExcelXML: Xml parser makelist() failed" 
    10961129    end if -- if listP(xmlList) then 
    10971130     
    10981131  else 
    1099     call(#mPut, mGetXScript(), "mParseExcelXML: Xml parser error: "&xmlp.getError()) 
     1132    put "mParseExcelXML: Xml parser error: "&xmlp.getError() 
    11001133  end if -- if voidP(xmlp.getError()) then 
    11011134   
     
    11131146  -- INPUT: <pfad> ; string ; full pathname to plist file. This is optional, if it is void or "" a file selection dialog is displayed  
    11141147  -- RETURNS: property list 
    1115   -- EXAMPLE: plist = xscr(#PseudoXMLPS).mReadPList() 
     1148  -- EXAMPLE: plist = new(script "PseudoXMLPS").mReadPList() 
    11161149  ----------------------------------- 
    11171150   
     
    11861219 
    11871220on mGetListFromPListString me, str 
    1188   return mConvertKeyList(me, mGetListFromXMLString(me, str, 0)) 
     1221  return mConvertKeyList(me, mGetListFromXMLStringX(me, str, 0)) 
    11891222end 
    11901223 
  • trunk/lingosource/castlib2/aleXtrasMovieScript.ls

    r186 r228  
    4949      halt 
    5050    end if 
     51     
     52    if voidP(cms.script) then -- strangely enough this happened suddenly, dunno why... 
     53      -- until now it happened only in authoring with the stopped movie 
     54      -- therefore I just exit here without alert 
     55      halt 
     56    end if 
     57     
    5158    alextras = rawnew(cms.script) 
    5259    if ilk(alextras) <> #instance then 
     
    5562    end if 
    5663    (script "aleXtrasMovieScript").pAleXtras = alextras 
     64     
    5765  end if 
    5866  return alextras 
  • trunk/lingosource/castlib2/commonMovieScript.ls

    r215 r228  
    387387  --         ACTION: Create/Get timeout object 
    388388  --                 This handler works the same with the old player <10 and the new player >=10 
    389   --         INPUT: ||ÊtheName     || string  || name for new timeout object|| 
    390   --                ||ÊtheDuration || integer || timeout perios in milliseconds|| 
     389  --         INPUT: || theName     || string  || name for new timeout object|| 
     390  --                || theDuration || integer || timeout perios in milliseconds|| 
    391391  --                || theHandler  || symbol  || handler to be called on each timepout event|| 
    392392  --                || theTarget   || object  || object to be sent the timeout event <theHandler>|| 
     
    17051705-- dummy handler for translate function 
    17061706 
    1707 on mTranslate me, aString 
     1707on mTranslate me, aString, variablesList 
    17081708  theGlobs = mGetGlobalList(me) 
    17091709  uebersetzungsListe = theGlobs.getaprop(#gUebersetzung) 
     
    17111711  uebersetzung = uebersetzungsListe.getaprop(aString) 
    17121712  if voidP(uebersetzung) then 
     1713    if listP(variablesList) then return mReplacePlaceHoldersInString(me, aString, variablesList) 
    17131714    return aString 
    17141715  else 
     
    17251726end 
    17261727 
     1728-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     1729 
     1730on mReplacePlaceHoldersInString me, aString, variablesList 
     1731  if ilk(variablesList) = #proplist then 
     1732    cnt = count(variablesList) 
     1733    if cnt > 0 then 
     1734      repeat with n = 1 to cnt 
     1735        str = string(variablesList[n]) 
     1736        prop = variablesList.getPropAt(n) 
     1737        srchStr = "%%" & prop & "%%" 
     1738        len = length(srchStr) - 1 
     1739        offs = offset(srchStr, aString) 
     1740        repeat while offs > 0 
     1741          put str into char offs to offs + len of aString 
     1742          offs = offset(srchStr, aString) 
     1743        end repeat 
     1744      end repeat         
     1745    end if 
     1746  else if ilk(variablesList) = #list then -- printf like replacement 
     1747    if count(variablesList) > 0 then 
     1748      offs = offset("%s", aString) 
     1749      str = string(variablesList[1]) 
     1750      repeat while offs > 0 
     1751        put str into char offs to offs + 1 of aString 
     1752        if count(variablesList) > 1 then variablesList.deleteAt(1) 
     1753        offs = offset("%s", aString) 
     1754      end repeat 
     1755    end if 
     1756  end if 
     1757  return aString 
     1758end 
    17271759 
    17281760-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
  • trunk/lingosource/castlib2/memberInfo.xml

    r198 r228  
    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        <subversionVersionChecker> 
     
    4747                <comments>~/Documents/Scripts/lingo/subversionVersionChecker.ls</comments> 
    4848                <memberName>subversionVersionChecker</memberName> 
    49                 <fName>subversionVersionChecker</fName> 
     49                <fname>subversionVersionChecker</fname> 
    5050        </subversionVersionChecker> 
    5151</Untitled> 
Note: See TracChangeset for help on using the changeset viewer.