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

Changeset 63 for trunk/lingosource


Ignore:
Timestamp:
11/30/07 13:51:25 (4 years ago)
Author:
alex
Message:

fixed bug where rename file wouldn't work for txt and html

Location:
trunk/lingosource
Files:
17 added
5 edited

Legend:

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

    r45 r63  
    1414  li = [] 
    1515  pLookUpCommandList = [:] 
    16    
    17   --------------------------------------------------- 
    18   li.add("Fix colors in scriptlists (SES 10 -> SES 9)") 
    19   pLookUpCommandList.setaprop("Fix colors in scriptlists (SES 10 -> SES 9)", "Authoring_ExchangeScriptListColorsToRGBs me") 
    20    
    21    
    22   --------------------------------------------------- 
    23   li.add("Castmember Thumbnails") 
    24   subli = [] 
    25   li.add(subli) 
    26    
    27   subli.add("Make castlib label...") 
    28   pLookUpCommandList.setaprop("Make castlib label...", "makeLabel me, theContent, theBackgroundColor_optional, memberRef_optional") 
    2916   
    3017   
     
    4835    li.add(subli) 
    4936     
     37    subli.add("Edit in BBEdit") 
     38    pLookUpCommandList.setaprop("Edit in BBEdit", "mOpen_text_with_BBedit me") 
     39     
    5040    subli.add("Open linked script") 
    5141    pLookUpCommandList.setaprop("Open linked script", "mOpen_Linked_Script_With_BBedit me") 
    52      
    53     subli.add("Open text") 
    54     pLookUpCommandList.setaprop("Open text", "mOpen_text_with_BBedit me") 
    5542     
    5643    subli.add("Diff selected script") 
     
    263250  pLookUpCommandList.setaprop("SVN Update ScriptText in Working Copy...", "mSVN_Update_Working_Copy_ScriptText me, chooseNewPath_optional") 
    264251   
    265     subli.add("") 
    266     subli.add("SVN Import Scripts, Text and Fields from working copy...") 
     252  subli.add("") 
     253  subli.add("SVN Import Scripts, Text and Fields from working copy...") 
    267254  pLookUpCommandList.setaprop("SVN Import Scripts, Text and Fields from working copy...", "mSVN_Update_And_Import_ScriptsFromFolder me, chooseNewPath_optional, selectionOnly_optional") 
    268255   
     
    332319  ---------------------------------------------------- 
    333320   
     321   
     322  li.add("") 
     323   
     324  li.add("Misc.") 
     325  subli = [] 
     326  li.add(subli) 
     327   
     328  subli.add("Convert textmember to HTML + copy to clipboard") 
     329  pLookUpCommandList.setaprop("Convert textmember to HTML + copy to clipboard", "mCopyConvert2HTML") 
     330   
     331   
     332  --------------------------------------------------- 
     333  subli.add("Fix colors in scriptlists (SES 10 -> SES 9)") 
     334  pLookUpCommandList.setaprop("Fix colors in scriptlists (SES 10 -> SES 9)", "Authoring_ExchangeScriptListColorsToRGBs me") 
     335   
     336   
     337  li.add("") 
     338   
     339  --------------------------------------------------- 
     340  li.add("Castmember Thumbnails") 
     341  subli = [] 
     342  li.add(subli) 
     343   
     344  subli.add("Make castlib label...") 
     345  pLookUpCommandList.setaprop("Make castlib label...", "makeLabel me, theContent, theBackgroundColor_optional, memberRef_optional") 
     346   
     347   
     348  --------------------------------------------------- 
    334349   
    335350  li.add("") 
     
    338353  li.add("Open containing folder in" && fnd) 
    339354  pLookUpCommandList.setaprop("Open containing folder in" && fnd, "mOpenContainingFolder me") 
    340    
    341   li.add("") 
    342   li.add("Convert textmember to HTML + copy to clipboard") 
    343   pLookUpCommandList.setaprop("Convert textmember to HTML + copy to clipboard", "mCopyConvert2HTML") 
    344355   
    345356   
  • trunk/lingosource/castlib1/alexUtilities.ls

    r51 r63  
    604604-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    605605 
    606 on mExportBM me, BMmember, thePath, theType, compr 
     606on mExportBM me, BMmember, thePath, theType, compr, xtraInst 
    607607   
    608608  -- first check all arguments: 
     
    667667  theDot = offset(".", thePath) 
    668668  if theDot = 0 then thePath = thePath&"."&theType 
    669   else thePath = thePath.char[1 .. theDot]&theType 
     669  -- else thePath = thePath.char[1 .. theDot]&theType 
    670670   
    671671   
    672672  -- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    673673  -- create an instance of Werner Sharps cool Xtra: 
    674   xtraInst = new (xtra "SharpExport") 
    675674  if not(objectP(xtraInst)) then 
    676     if delmem then tempmember.erase() 
    677     alert "Sharp Xtra missing" 
    678     exit 
     675    xtraInst = new (xtra "SharpExport") 
     676    if not(objectP(xtraInst)) then 
     677      if delmem then tempmember.erase() 
     678      alert "Sharp Xtra missing" 
     679      exit 
     680    end if 
     681    delXtra = 1 
    679682  end if 
    680683   
     
    749752  -- cleanup 
    750753  if delmem then tempmember.erase() 
    751   xtraInst = 0 
     754  if delXtra = 1 then xtraInst = 0 
    752755   
    753756  -- return boolean for success 
     
    22062209  sel = the selection of castlib cl 
    22072210   
    2208   theText = "" 
     2211   
    22092212  repeat with sub in sel 
    22102213    repeat with mem = sub[1] to sub[2] 
    2211       memref = member(mem,cl)    
    2212       if memref.type = #script then 
     2214       
     2215      memref = member(mem,cl) 
     2216       
     2217      theText = "" 
     2218      theType = memref.type 
     2219      if theType = #script then 
    22132220        theText = memref.scripttext 
    2214       else if [#text, #field].getPos(memref.type) > 0 then 
     2221      else if theType = #text then 
     2222        theText = memref.html 
     2223      else if theType = #field then 
    22152224        theText = memref.text 
    22162225      end if 
     2226       
    22172227      if length(theText) > 0 then 
    22182228         
    2219         neuer = new(#field) 
    2220         neuer.text = theText 
    2221          
    2222         oldclipboardNum = new(#field) 
    2223         oldclipboardNum.pasteClipBoardInto() 
    2224          
    2225         copyToClipBoard(neuer) 
    2226          
    2227         shell_cmd("pbpaste | bbedit") 
    2228          
    2229         if oldclipboardNum.type <> #empty then copyToClipBoard(oldclipboardNum) 
    2230         oldclipboardNum.erase() 
    2231         neuer.erase() 
    2232          
    2233         exit 
     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         
    22342267      end if 
    22352268    end repeat 
     
    24532486  --------------------- 
    24542487  -- create a temporary file from scripttext: 
    2455   tempSrcPath = shell_cmd_list("mktemp -t temp_BBDiff_file1") 
    2456   tempSrcPath = tempSrcPath[1] 
     2488  --  tempSrcPath = shell_cmd_list("mktemp -t temp_BBDiff_file1") 
     2489  --  tempSrcPath = tempSrcPath[1] 
     2490  tempSrcPath = "/tmp/temp_BBDiff_file1.ls" 
    24572491  tempSrcHFSPath = shell_cmd_list("osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath & "\" & QUOTE & " as string" & QUOTE) 
    24582492  tempSrcHFSPath = tempSrcHFSPath[1] 
     
    24782512    --------------------- 
    24792513    -- create a temporary file from scripttext: 
    2480     tempSrcPath2 = shell_cmd_list("mktemp -t temp_BBDiff_file2") 
    2481     tempSrcPath2 = tempSrcPath2[1] 
     2514    --    tempSrcPath2 = shell_cmd_list("mktemp -t temp_BBDiff_file2") 
     2515    --    tempSrcPath2 = tempSrcPath2[1] 
     2516    tempSrcPath2 = "/tmp/temp_BBDiff_file2.ls" 
    24822517    tempSrcHFSPath2 = shell_cmd_list("osascript -e" && QUOTE & "return POSIX file \" & QUOTE & tempSrcPath2 & "\" & QUOTE & " as string" & QUOTE) 
    24832518    tempSrcHFSPath2 = tempSrcHFSPath2[1] 
     
    32323267            ----------------------- 
    32333268          #text: 
    3234             ext = ".rtf" 
    3235             st = memref.rtf 
     3269            ext = ".html" 
     3270            st = memref.html 
    32363271             
    32373272            ----------------------- 
     
    33783413                  offs = offset(fndStr, scrText) 
    33793414                  repeat while offs > 0 
    3380                     put numToChar(13) & numToChar(10) into char offs of scrText 
     3415                    put "ÀÀÀ" into char offs of scrText 
    33813416                    offs = offset(fndStr, scrText) 
    33823417                  end repeat 
     
    34203455                ----------------------- 
    34213456              #text: 
    3422                 memref.rtf = scrText 
     3457                memref.html = scrText 
    34233458                 
    34243459                ----------------------- 
     
    34913526            ----------------------- 
    34923527          #text: 
    3493             ext = ".rtf" 
    3494             st = memref.rtf 
     3528            ext = ".html" 
     3529            st = memref.html 
    34953530             
    34963531            ----------------------- 
     
    36163651   
    36173652   
    3618    
    3619    
    36203653  cnt = count(infolist) 
    36213654   
     
    36303663       
    36313664      --      put "path:" && fpath  
    3632        
    3633       if baFileExists(fpath) then return fpath 
     3665      if length(baShortFilename(fpath)) > 0 then return fpath 
     3666       
     3667      -- if baFileExists(fpath) then return fpath 
    36343668       
    36353669    end if 
     
    36923726    end if 
    36933727  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   
    36943746   
    36953747   
     
    37093761        alert "Failed to create directory:" && thisFolder 
    37103762        if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
     3763        DirectImageInstance = 0 
    37113764        exit 
    37123765      end if 
     
    37353788         
    37363789        memtype = memref.type 
     3790         
     3791        -- if [#script].getPos(memtype) > 0 then 
    37373792        if [#script, #field, #text].getPos(memtype) > 0 then 
    37383793           
     
    37513806              ----------------------- 
    37523807            #text: 
    3753               ext = ".rtf" 
    3754               scrText = memref.rtf 
     3808              ext = ".html" 
     3809              scrText = memref.html 
    37553810              convertLineBreaksToUnix = 0 
    37563811              scrtype = #text 
     
    37773832          ------------- but currently I stick to the memberInfo.xml approach to store the metadata 
    37783833          ------------- so the following is disabled ... meanwhile... 
     3834          ------------- the "memberInfo.xml" approach is more svn like anyway 
     3835           
    37793836           
    37803837          --          ------------------------------ check for existing meta data 
     
    38043861          if length(theDefaultName) < 1 then 
    38053862            theDefaultName =  "member" & n & "_" & m 
    3806             alert memref && "has no membername! Member without names will cause trouble when re-importing the scripts."  
     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             
    38073874          end if 
    38083875           
     3876           
     3877           
    38093878          -- if offset(".", theDefaultName) < 1 then put ".ls" after theDefaultName 
    38103879           
    3811           offs = offset(" ", theDefaultName) 
    3812           repeat while offs > 0 
    3813             put "_" into char offs of theDefaultName 
    3814             offs = offset(" ", theDefaultName) 
    3815           end repeat 
    3816            
    3817           offs = offset("/", theDefaultName) 
    3818           repeat while offs > 0 
    3819             put "_" into char offs of theDefaultName 
    3820             offs = offset("/", theDefaultName) 
    3821           end repeat 
    3822            
    3823           offs = offset(":", theDefaultName) 
    3824           repeat while offs > 0 
    3825             put "_" into char offs of theDefaultName 
    3826             offs = offset(":", theDefaultName) 
    3827           end repeat 
    3828            
    3829           offs = offset("\", theDefaultName) 
    3830           repeat while offs > 0 
    3831             put "_" into char offs of theDefaultName 
    3832             offs = offset("\", theDefaultName) 
    3833           end repeat 
    3834            
    3835           offs = offset("&", theDefaultName) 
    3836           repeat while offs > 0 
    3837             put "_" into char offs of theDefaultName 
    3838             offs = offset("&", theDefaultName) 
    3839           end repeat 
     3880          theDefaultName = mStripFunnyCharsFromFileName(me, theDefaultName) 
    38403881           
    38413882           
    38423883          origname = theDefaultName&"" 
    3843           if length(theDefaultName) > 26 and isMac then 
     3884          if length(theDefaultName) > 25 and isMac then 
    38443885             
    38453886            ms = string(the milliseconds) 
     
    38513892             
    38523893          end if 
    3853            
    3854            
    3855            
    38563894           
    38573895           
     
    39193957                if thumbmember.width > 0 then 
    39203958                  bmexp = 1 
    3921                   if baFileExists(thisFolder & theDefaultName & ".jpg") then baDeleteFile(thisFolder & theDefaultName & ".jpg") 
    3922                   mExportBM me, thumbmember, thisFolder & theDefaultName & ".jpg", "jpg" 
     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                   
    39233971                end if 
    39243972                 
     
    39323980                snam = baShortFileName(thisFolder & origname & ext) 
    39333981                if length(snam) > 0 then baDeleteFile(snam) 
    3934                 erg = baRenameFile(thisFolder & theDefaultName & ".ls", thisFolder & origname & ext) 
     3982                erg = baRenameFile(thisFolder & theDefaultName & ext, thisFolder & origname & ext) 
    39353983                if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ext & " to " & thisFolder & origname & ext 
    39363984                if bmexp = 1 then 
    3937                   snam = baShortFileName(thisFolder & origname & ".jpg") 
     3985                  snam = baShortFileName(thisFolder & origname & ".png") 
    39383986                  if length(snam) > 0 then baDeleteFile(snam) 
    3939                   erg = baRenameFile(thisFolder & theDefaultName & ".jpg", thisFolder & origname & ".jpg") 
    3940                   if erg <> 1 then put "Couldn't rename file " & thisFolder & theDefaultName & ".jpg to " & thisFolder & origname & ".jpg" 
     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" 
    39413989                end if 
    39423990                 
     
    39614009    end repeat 
    39624010     
    3963     if doit = 1 then mSaveList_2_XML me, infolist, infolistPath 
     4011    if doit = 1 then 
     4012      --      mSaveList_2_XML me, infolist, infolistPath 
     4013       
     4014      mRefreshMemberInfoList me, thisFolder, m, infolist 
     4015    end if 
     4016     
    39644017     
    39654018  end repeat 
    39664019   
     4020  DirectImageInstance = 0 
     4021  SharpExportInst = 0 
     4022   
    39674023  if statusSwitched = 1 then statusSwitched = mSwitchToStatusMode(me, 0) 
    39684024   
    39694025end 
     4026 
     4027-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     4028 
     4029on 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   
     4125end 
     4126 
     4127-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     4128 
     4129on 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   
     4163end 
     4164 
    39704165 
    39714166-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
     
    41254320    case scrtype of 
    41264321      #field: ext = ".txt" 
    4127       #text: ext = ".rtf" 
     4322      #text: ext = ".html" 
    41284323      otherwise: ext = ".ls" 
    41294324    end case 
     
    42434438             
    42444439            case dertyp of 
    4245               #text: ext = ".rtf" 
     4440              #text: ext = ".html" 
    42464441              #field: ext = ".txt" 
    42474442              otherwise: ext = ".ls"     
     
    43714566   
    43724567   
    4373   theIcon = thePath & fname & ".jpg" 
    4374    
    4375   --  if length(fname & ".jpg") > 31 and (the platform contains "mac") then 
     4568  theIcon = thePath & fname & ".png" 
     4569   
     4570  --  if length(fname & ".png") > 31 and (the platform contains "mac") then 
    43764571  --     
    43774572  --    unixname = baUnixName(theIcon) 
    43784573  --    if length(unixname) > 0 then 
    43794574  --      tempSrcPath = shell_cmd_list("mktemp -t temp_icon_file.XXXX") 
    4380   --      tempSrcPath = tempSrcPath[1] & ".jpg" 
     4575  --      tempSrcPath = tempSrcPath[1] & ".png" 
    43814576  --      shell_cmd_list("cp " & QUOTE & unixname & QUOTE && QUOTE& tempSrcPath &QUOTE) 
    43824577  --      theIcon = baHFSName(tempSrcPath) 
     
    44884683      offs = offset(fndStr, scrText) 
    44894684      repeat while offs > 0 
    4490         put "ÀÀÀ" into char offs+1 of scrText 
     4685        put numToChar(13) into char offs+1 of scrText 
    44914686        offs = offset(fndStr, scrText) 
    44924687      end repeat 
     
    44964691      offs = offset(fndStr, scrText) 
    44974692      repeat while offs > 0 
    4498         put numToChar(13) & numToChar(10) into char offs of scrText 
     4693        put numToChar(13) into char offs of scrText 
    44994694        offs = offset(fndStr, scrText) 
    45004695      end repeat 
    45014696       
    4502        
    4503        
    4504       fndStr = numToChar(13) & "ÀÀÀ" 
    4505       offs = offset(fndStr, scrText) 
    4506       repeat while offs > 0 
    4507         put numToChar(13) & numToChar(10) into char offs to offs+3 of scrText 
    4508         offs = offset(fndStr, scrText) 
    4509       end repeat 
    4510        
    4511        
    4512        
    4513       fndStr = "ÀÀÀ" 
    4514       offs = offset(fndStr, scrText) 
    4515       repeat while offs > 0 
    4516         put numToChar(13) & numToChar(10) into char offs to offs+2 of scrText 
    4517         offs = offset(fndStr, scrText) 
    4518       end repeat 
    4519        
    45204697    end if 
    45214698     
     
    45274704  case scrtype of 
    45284705    #field: scr.text = scrtext 
    4529     #text: scr.rtf = scrtext 
    4530     otherwise: memtype = scr.scripttext = scrtext 
     4706    #text: scr.html = scrtext 
     4707    otherwise: scr.scripttext = scrtext 
    45314708  end case 
    45324709   
     
    46944871  end if 
    46954872   
    4696       if count(infolist) < 1 then 
    4697        
    4698       alert "The specified folder doesn't seem to contain info for this castlib: file memberInfo.xml missing." 
    4699       return 0 
    4700        
    4701     end if 
     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 
    47024879   
    47034880  doCommit = 0 
     
    47074884  sel = the selection of castlib cl 
    47084885  anz = sel.count 
    4709   cnt = 1 
     4886  cnt = count(infolist) 
    47104887  repeat with n = 1 to anz 
    47114888    repeat with m = sel[n][1] to sel[n][2] 
    47124889      memref = member(m, cl) 
    47134890      dertyp = memref.type 
     4891       
     4892      put "processing member" && memref 
     4893       
    47144894      if [#script, #field, #text].getPos(dertyp) then 
    47154895         
     4896        putstr = "" 
    47164897        repeat with l = 1 to cnt 
    47174898          li = infolist[l] 
     4899           
     4900          -- put "listref  =" && li 
    47184901           
    47194902          if li.getaprop(#memberName) = memref.name then 
     
    47254908            case scrtype of 
    47264909              #field: ext = ".txt" 
    4727               #text: ext = ".rtf" 
     4910              #text: ext = ".html" 
    47284911              otherwise: ext = ".ls" 
    47294912            end case 
    47304913             
    47314914            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 
    47324923             
    47334924            if baFileExists(fpath) then 
     
    47474938              end if 
    47484939               
    4749               li.deleteAt(l) 
     4940              infolist.deleteAt(l) 
    47504941              memref.erase() 
    47514942              saveRequired = 1 
    47524943              put "Erase member:" && memref.name 
    47534944               
     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               
    47544953            end if 
    47554954             
    47564955          end if 
     4956           
    47574957        end repeat 
     4958         
     4959        if length(putstr) then put putstr 
    47584960         
    47594961      end if 
     
    47674969      saveMovie() 
    47684970    end if 
     4971     
     4972    mRefreshMemberInfoList me, thePath, castlib(cl).number 
    47694973     
    47704974  end if 
  • trunk/lingosource/castlib1/memberInfo.xml

    r49 r63  
    1313                <fName>keyboardNavigation_FrameLoop</fName> 
    1414        </keyboardNavigation_FrameLoop> 
     15        <menu1_button> 
     16                <scriptType>#text</scriptType> 
     17                <comments></comments> 
     18                <memberName>menu1_button</memberName> 
     19                <fName>menu1_button</fName> 
     20        </menu1_button> 
     21        <menu2_button> 
     22                <scriptType>#text</scriptType> 
     23                <comments></comments> 
     24                <memberName>menu2_button</memberName> 
     25                <fName>menu2_button</fName> 
     26        </menu2_button> 
    1527        <simpleBMMenu> 
    1628                <scriptType>#score</scriptType> 
     
    4355                <fName>OSCmenu_Handlers</fName> 
    4456        </OSCmenu_Handlers> 
    45         <resizewindowfs> 
    46                 <scriptType>#score</scriptType> 
    47                 <comments></comments> 
    48                 <memberName>resizewindowfs</memberName> 
    49                 <fName>resizewindowfs</fName> 
    50         </resizewindowfs> 
    51         <showHideHelp> 
    52                 <scriptType>#score</scriptType> 
    53                 <comments></comments> 
    54                 <memberName>showHideHelp</memberName> 
    55                 <fName>showHideHelp</fName> 
    56         </showHideHelp> 
    57         <texthyperlinkBehavior> 
    58                 <scriptType>#score</scriptType> 
    59                 <comments>/Users/alex/Documents/ALIEN/myLinkedScripts/texthyperlinkBehavior.ls</comments> 
    60                 <memberName>texthyperlinkBehavior</memberName> 
    61                 <fName>texthyperlinkBehavior</fName> 
    62         </texthyperlinkBehavior> 
    63         <bbdiff> 
    64                 <scriptType>#movie</scriptType> 
    65                 <comments></comments> 
    66                 <memberName>bbdiff</memberName> 
    67                 <fName>bbdiff</fName> 
    68         </bbdiff> 
    69         <menu1_button> 
    70                 <scriptType>#text</scriptType> 
    71                 <comments></comments> 
    72                 <memberName>menu1_button</memberName> 
    73                 <fName>menu1_button</fName> 
    74         </menu1_button> 
    75         <menu2_button> 
    76                 <scriptType>#text</scriptType> 
    77                 <comments></comments> 
    78                 <memberName>menu2_button</memberName> 
    79                 <fName>menu2_button</fName> 
    80         </menu2_button> 
    8157        <pastefeld> 
    8258                <scriptType>#field</scriptType> 
     
    9773                <fName>searchword</fName> 
    9874        </searchword> 
     75        <resizewindowfs> 
     76                <scriptType>#score</scriptType> 
     77                <comments></comments> 
     78                <memberName>resizewindowfs</memberName> 
     79                <fName>resizewindowfs</fName> 
     80        </resizewindowfs> 
     81        <showHideHelp> 
     82                <scriptType>#score</scriptType> 
     83                <comments></comments> 
     84                <memberName>showHideHelp</memberName> 
     85                <fName>showHideHelp</fName> 
     86        </showHideHelp> 
    9987        <helptext> 
    10088                <scriptType>#text</scriptType> 
     
    10694                <fName>helptext</fName> 
    10795        </helptext> 
     96        <texthyperlinkBehavior> 
     97                <scriptType>#score</scriptType> 
     98                <comments>/Users/alex/Documents/ALIEN/myLinkedScripts/texthyperlinkBehavior.ls</comments> 
     99                <memberName>texthyperlinkBehavior</memberName> 
     100                <fName>texthyperlinkBehavior</fName> 
     101        </texthyperlinkBehavior> 
     102        <bbdiff> 
     103                <scriptType>#movie</scriptType> 
     104                <comments></comments> 
     105                <memberName>bbdiff</memberName> 
     106                <fName>bbdiff</fName> 
     107        </bbdiff> 
    108108        <statusOutput> 
    109109                <scriptType>#text</scriptType> 
     
    115115                <fName>statusOutput</fName> 
    116116        </statusOutput> 
    117         <test> 
    118                 <scriptType>#text</scriptType> 
    119                 <comments></comments> 
    120                 <memberName>test</memberName> 
    121                 <fName>test</fName> 
    122         </test> 
    123         <tester2> 
    124                 <scriptType>#text</scriptType> 
    125                 <comments></comments> 
    126                 <memberName>tester2</memberName> 
    127                 <fName>tester2</fName> 
    128         </tester2> 
    129         <tester4> 
    130                 <scriptType>#field</scriptType> 
    131                 <comments></comments> 
    132                 <memberName>tester4</memberName> 
    133                 <fName>tester4</fName> 
    134         </tester4> 
    135117</Untitled> 
  • trunk/lingosource/castlib1/pastefeld.txt

    r42 r63  
    1 theResult = sendSprite(3, #mGetItemByTitle, [], "mouseUp") 
     1<html> 
     2<head> 
     3<title>Untitled</title> 
     4        <style type="text/css"> 
     5                #code 
     6                { 
     7                        margin: 10.0px 5.0px 10.0px 20.0px; 
     8                        font: 9.0px Monaco,Courier; 
     9                        background-color: #EEEEEE; 
     10                        padding: 10px; 
     11                        border-color: #AAAAAA; 
     12                        border-width: 1px 2px 2px 1px; 
     13                        border-style: solid; 
     14                        text-align: left; 
     15                        overflow: auto; 
     16                } 
     17                #code #clr1 { color: #C80000; } 
     18                #code #clr2 { color: #0000C8; } 
     19                #code #clr3 { color: #004000; } 
     20                #code #clr4 { color: #404040; } 
     21        </style> 
     22 
     23</head> 
     24<body bgcolor="#FFFFFF"> 
     25<pre id="code"> 
     26<span id="clr2">property</span> pMenuSpritename 
     27 
     28<span id="clr1">-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span> 
     29 
     30<span id="clr2">on</span><span id="clr3"> mouseDown</span><span id="clr2"> me</span> 
     31  spr =<span id="clr3"> sprite</span>(<span id="clr2">me</span>.<span id="clr3">spritenum</span>) 
     32  spr.<span id="clr3">member</span>.<span id="clr3">color</span> =<span id="clr3"> rgb</span>(<span id="clr4">255</span>,<span id="clr4"> 255</span>,<span id="clr4"> 255</span>) 
     33<span id="clr3">  sprite</span>(xscr().mGetKanal(<span id="clr3">&#35;</span>blueBackGround)).<span id="clr3">rect</span> = spr.<span id="clr3">rect</span> <span id="clr1">-- blue background</span> 
     34<span id="clr3">  updatestage 
     35  sendSprite</span>(xscr().mGetKanal(pMenuSpritename),<span id="clr3"> &#35;</span>mShowOSCMenu,<span id="clr2"> me</span>.<span id="clr3">spritenum</span>) 
     36<span id="clr2">end</span> 
     37 
     38<span id="clr1">-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span> 
     39 
     40<span id="clr2">on</span><span id="clr3"> endsprite</span><span id="clr2"> me</span> 
     41<span id="clr3">  sprite</span>(<span id="clr2">me</span>.<span id="clr3">spritenum</span>).<span id="clr3">member</span>.<span id="clr3">color</span> =<span id="clr3"> rgb</span>(<span id="clr4">20</span>,<span id="clr4"> 20</span>,<span id="clr4"> 20</span>) 
     42<span id="clr2">end</span> 
     43 
     44<span id="clr1">-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span> 
     45 
     46<span id="clr2">on</span><span id="clr3"> getpropertyDescriptionList</span> 
     47  retlist = [&#58;] 
     48  retlist[<span id="clr3">&#35;</span>pMenuSpritename] = [<span id="clr3">&#35;default</span>&#58;<span id="clr3">&#35;nothing</span>,<span id="clr3"> &#35;format</span>&#58;<span id="clr3">&#35;symbol</span>,<span id="clr3"> &#35;comment</span>&#58;<span id="clr4">&quot;Name of sprite with menu&#58;&quot;</span>] 
     49<span id="clr2">  return</span> retlist 
     50<span id="clr2">end</span> 
     51 
     52<span id="clr1">-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span> 
     53 
     54<span id="clr2">on</span> mUnhilite<span id="clr2"> me</span> 
     55<span id="clr3">  sprite</span>(<span id="clr2">me</span>.<span id="clr3">spritenum</span>).<span id="clr3">member</span>.<span id="clr3">color</span> =<span id="clr3"> rgb</span>(<span id="clr4">20</span>,<span id="clr4"> 20</span>,<span id="clr4"> 20</span>) 
     56<span id="clr3">  sprite</span>(xscr().mGetKanal(<span id="clr3">&#35;</span>blueBackGround)).<span id="clr3">locV</span> = -<span id="clr4">1000</span> <span id="clr1">-- blue background</span> 
     57<span id="clr2">end if</span></pre> 
     58</body> 
     59</html> 
  • trunk/lingosource/castlib1/simpleBMMenu.ls

    r1 r63  
    11property pMenuSpritename 
    2  
    32-- xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
    43 
Note: See TracChangeset for help on using the changeset viewer.