dcsimg
A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Passing command line var from Flash

  1. #1
    Member
    Join Date
    Sep 2000
    Posts
    67
    Can you pass command line vars from FScommand in FLASH? I haven't been able to. I want to run a program FileWriter.exe with command line vars

    FileWriter.exe take whatever is on the command line and wirtes it to a file. But, when I do a FScommand filewriter.exe Writethis, the commandl ine portion is missing and only filewriter.exe gets written to a file. I am doing this so I can pass data from a standalone to user computer and write it to a file. If there is any easier way to do this, please someone let me know.

    Thanks in advance
    Stefan

  2. #2
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    The FSCommand processor in Flash cuts off everything after the first space. If you want to use FileWriter then you'll have to convert the spaces to tabs and hope that FileWriter can deal with it.

    You could also build your projector with SWF Studio (www.northcode.com) and use the free FILESYS plugin to create files like this.

    fscommand("ARG", "c:\\output\\files\\file.txt");
    fscommand("ARG", "this is the data I want to write");
    fscommand("FILESYS.WRITEFILE", ""); // that's it!

    You can download the FileSys example from http://www.northcode.com/free/ff2001 to see this in action. Feel free to contact me at support@northcode.com if you have any questions.

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    Ohh man..

    Making the statement a expression you can use & Chr(9) & or add Chr(9) add to place horizontal tab's on the command line.. this will qualify as parameters.. so if you wanted to start let's say windows notepad and you wanted to give it a file to open this would work

    "c:\windows\notepad.exe" & Chr(9) & "somefile.txt"

    "c:\windows\notepad.exe" add Chr(9) add "somefile.txt"

    I've also been told but haven't gotten around to testing it that \t will work as a horizontal tab in Flash 5 I also believe you don't need to make the FsCommand Exec statement a expression

    Lastly if you have trouble with your program you should try my program ftooltext it may be of more help to you.. (check my profile for a link)
    [Edited by The Master on 07-12-2001 at 04:45 AM]

  4. #4
    Member
    Join Date
    Sep 2000
    Posts
    67
    Is there a limit to the amount of info you can pass via the command line? Say I want to pass a lot of text to be written to a file 20kb or more? I know this is kind of a jacked solution for getting data out of Flash and onto a local machine (using the projector) Do you know of any simpler means? Do you know if it would be possible to write a program that sits and listens at whatever place flash is sending its loadvar or xml stuff to capture it on a local machine a write it to a file?

    Stefan

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    No Limit

    I don't know of any program that does what your talking about.. that would probably require custom programming.

  6. #6
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766

    Stefan, you can write as much data as you like with SWF Studio using the FILESYS.WRITEFILE command. I've done all the custom programming for you and wrapped it up inside SWF Studio.

  7. #7
    Member
    Join Date
    Sep 2000
    Posts
    67

    NorthPoint APpend

    can you Append files with FILESYS.WRITEFILE? THis is what I really need

    Stefan

  8. #8
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766

    How about a new command like FILESYS.APPENDFILE to get the job done? This would be a pretty simple addition to the FILESYS plugin.


  9. #9
    Member
    Join Date
    Sep 2000
    Posts
    67
    Sure that would be great, how much work it that actually? How have you done it? Right now I have a little shell program that reads the FS Command exec and the arguments passed to it and writes everything to a file that was passed on the command line, however there is the space,tab,return, and period issue. My solution hasn't been to elegant, and I like what you have done with the swf studio thing. I will get the company that I work with to purchase your software since it is able to do somethings that we have been looking for, namely writing files and launching pdfs.

    Thanks
    Stefan


  10. #10
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766

    The APPENDFILE command has been added to the FILESYS plugin. You can see the new documentation and download it from http://www.northcode.com/studio/plugins/filesys.html

  11. #11
    Member
    Join Date
    Sep 2000
    Posts
    67
    Right On!

    Your software is exactly what we need, we (Barrett Kendall Publishing) will be purchasing it shortly.

    Thanks

    Stefan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center