Team Development / Exporting stuff to text files

Richmond Mathewson geradamas at yahoo.com
Mon Mar 3 06:30:14 EST 2008


Chipp wrote:

"You mean something like?

on mouseUp
  repeat with x = 1 to the number of cds in this stack
    put the long name of cd x &cr& the script of cd x
&cr&cr after tScripts
    repeat with y=1 to the number of controls on cd x
      put the long name of control y of cd x &cr& the
script of
control y of cd x &cr&cr after tScripts
    end repeat
  end repeat
  answer file "Text file to export scripts to:"
  if it is empty or the result is "cancel" then exit
to top
  put tScripts into URL ("file:" & it)
end mouseUp"

no, not really:

on mouseUp
  palette "SS"
  --get the name of toplevel stack
  put the topstack into fld "fTARGET"
  put " " into PHPHSCRIPTS
    put 1 into XXX
  ---------- snatches scripts from main stack
----------
  put the num of cds of stack fld "fTARGET" into
CDNUMS
    repeat with K= 1 to CDNUMS
      put the num of controls of cd K of stack fld
"fTARGET" into KONTROLS
      repeat with M= 1 to KONTROLS
        put XXX into fld "Z"
        put fld "fTARGET" && "CARD:" && K && the short
name of control M of cd K of stack fld "fTARGET"  &&
the script of control M of cd K of stack fld "fTARGET"
into fld "fSCRIPTS"
        put fld "fSCRIPTS" into PHSCRIPTS
        put PHSCRIPTS && PHPHSCRIPTS into ADDER
        PUT ADDER into PHPHSCRIPTS
        put ADDER into fld "fADDER"
        put XXX + 1 into YYY
        put YYY into XXX
      end repeat
    end repeat
  ---------- snatches scripts from sub-stacks
----------
  put the substacks of stack fld "fTARGET" into fld
"fSUBS"
  repeat for each line I in fld "fSUBS"
    put the num of cds of stack I into CDNUMS
    repeat with K= 1 to CDNUMS
      put the num of controls of cd K of stack I into
KONTROLS
      repeat with M= 1 to KONTROLS
        put XXX into fld "Z"
        put I && "CARD:" && K && the short name of
control M of cd K of stack I  && the script of control
M of cd K of stack I into fld "fSCRIPTS"
        put fld "fSCRIPTS" into PHSCRIPTS
        put PHSCRIPTS && PHPHSCRIPTS into ADDER
        PUT ADDER into PHPHSCRIPTS
        put ADDER into fld "fADDER"
        put XXX + 1 into YYY
        put YYY into XXX
      end repeat
    end repeat
  end repeat
  ------------------- saves snatch scripts where you
want them -------
  ask file "NAME SNATCHED SCRIPTS FILE:" with
"SSCRIPTS.txt"
  if the result = "cancel" then exit mouseUp
  put it into tFName
  if char -4 to -1 of tFName is not ".txt" then put
".txt" after tFName
  put field "fADDER" into url("file:" & tFName)
  -------------------
  toplevel "SS"
end mouseUp

"Or..are you getting the scripts of substacks as
well?"

Yes:

here is an example of the output:

SubOne CARD: 1 Button on mouseUp
  ---eat my socks
end mouseUp
 stack "/Users/jrm/Desktop/Fun/MainOne.rev" CARD: 1
Button on mouseUp
  beep
end mouseUp
  
Download the stack and "give it a whirl".

Love, Richmond

____________________________________________________________

A Thorn in the flesh is better than a failed Systems Development Life Cycle.
____________________________________________________________


      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Inbox. http://uk.docs.yahoo.com/nowyoucan.html



More information about the Use-livecode mailing list