Export stack scripts

thierry douez at wanadoo.fr
Wed Oct 13 03:49:24 EDT 2004


Hi all ,

  To export all the scripts, i did used an old metacard script
  which is not from me ( sorry, i forgot the writer of this one ! )
   ( see it below )
   
  then, i did check few days ago, the Notepad++ text editor, which is
  a free software, and in an hour, i've made my own
  simple coloration for Revolution's scripts...
  quick fast and efficient.  
  the interesting thing is that you have a title for each script and in an
  editor like notepad++ or some other, you can easily expand or not
  every control script... this give you a very powerful overview of
  all the application ( well, at least for me :-)  ) and i'm used to
  print all the scripts from this editor. Before i was using the
  free Context editor ( pc users too ).

  et voila, Hope this help.
  
Best regards, thierry



----- Here is the script to put anywhere you like to.

# Write all scripts in Revolution stack to text file.

on mouseUp
  ask file "Where do you want to put the scripts?"  with "BioArchimed_scripts.txt"
  if it is  empty then exit mouseUp
  put it into file_name
  open file file_name for write
  if the result is not empty then
    answer ("Couldn't open file. " && result() & " : " & (the sysError)) with "OK"
    exit mouseUp
  end if
  
  set the cursor to watch
  set the defaultStack to "EditBioArchimed"
  write ("SCRIPTDUMP_START: " & the long name of this stack & cr &\
  the long date && the time & cr & cr ) to file file_name
  
  write ( "CONTROL_TYPE: MAINSTACK" & cr ) to file file_name
  write ( the script of this stack ) to file file_name
  write ( "END_OBJECT" & cr & cr ) to file file_name
  
  repeat with i = 1 to the number of cards
    
    write ( "CONTROL_TYPE: BUTTONS" & cr ) to file file_name
    repeat with b = 1 to the number of buttons of card i
      put the long name of button b of cd i into o_name
      write ( "OBJECT: " &  o_name & cr ) to file file_name
      write ( the script of button b of cd i) to file file_name
      write ( "END_OBJECT" & cr & cr ) to file file_name
    end repeat
    
    write ( "CONTROL_TYPE: IMAGES" & cr ) to file file_name
    repeat with im = 1 to the number of images of card i
      put the long name of image im of cd i into o_name
      write ( "OBJECT: " &  o_name & cr ) to file file_name
      write ( the script of image im of cd i ) to file file_name
      write ( "END_OBJECT" & cr & cr ) to file file_name
    end repeat
    
    write ( "CONTROL_TYPE: FIELDS" & cr ) to file file_name
    repeat with f = 1 to the number of fields of card i
      put the long name of field f of cd i into o_name
      write ( "OBJECT: " & o_name  & cr ) to file file_name
      write ( the script of field f of cd i) to file file_name
      write ( "END_OBJECT" & cr & cr ) to file file_name
    end repeat
    
    write ( "CONTROL_TYPE: SCROLLBARS" & cr ) to file file_name
    repeat with s = 1 to the number of scrollbars of card i
      put the long name of scrollbar s of cd i into o_name
      write ( "OBJECT: " &  o_name & cr ) to file file_name
      write ( the script of scrollbar s of cd i) to file file_name
      write ( "END_OBJECT" & cr & cr ) to file file_name
    end repeat
    
  end repeat
  
  write "SCRIPTDUMP_END" to file file_name
  close file file_name
end mouseUp



More information about the use-livecode mailing list