Exec
This is the part of the Fs command that interacts with the operating system that it is being ran on. This is how you open local files, save files, open browser’s and other programs. The uses of this command are so great that they will be covered in the next two parts. The uses of this command are specific to which operating system it is running under. But it is not really that big of a problem since you do have to make a different projector for Mac’s and PC’s.
Specific Fs commands for windows 9x
This set of commands works with all flavors of windows. But you have to modify them a little bit to get them to run with NT 4, Win 2k, and Me. I will show you how to modify each one to work with each specific O/S. The good thing about this is you can add action’s to each button to work under every flavor of windows since it will not call an error if the command fails. These functions mainly deal with saving and deleting files to and from hard disks, and opening browser’s and programs.
Saving a file to hard disk
Maybe you want your projector to operate off of cookies, or you want to save some other type of information to the user’s hard drive. The only way this is possible is to use the Fs command. This is going to access command.com on the user’s system so it will open a dos window briefly. At this time there is no way around this, but on a moderately fast system it happens so fast that the user does not notice it. Also none of these Fs commands work for swf files on the internet, they have to be run locally to work.
Type this in the command box: exec
Type this in the arguments box with the expression box checked: "command.com" add chr(9) add "/c" add chr(9) add "echo" add chr(9) add "var1=" add textbox add ">textfile.txt"
Notice in the code for the arguments that var1= would what the variable is called in the text file. Also see that textbox is the variable from your Flash file, the contents of this will be saved. You need the = sign so it will save it in the text file like this var1=variable.
Deleting a file from hard disk
Maybe after the projector gets done running you want it to delete the file you created, you can use the code below to delete a file from hard disk. Again this only works on Windows 9x machines.
Type this in the command box: Exec
Type this in the arguments box with the expression box checked: "command.com" add chr(9) add "/c" add chr(9) add "del" add chr(9) add "textfile.txt"
You will see that textfile.txt is the name of the file that will be deleted and again you are accessing command.com to carry this procedure out.
Making a directory on hard disk
Its true that if you wanted to keep a cookie on the user’s computer that if you left it in the root folder more than likely it could get deleted when they cleaned their computer. However most people are more wary of deleting folders, so you can place the file in a folder you made.
Type this in the command box: Exec
Type this in the arguments box with the expression box checked: "command.com" add chr(9) add "/c" add chr(9) add "md" add chr(9) add "textfile"
Textfile is going to be the name of the directory you made with this command. Md is the command sent to dos to make the directory.
Starting a file from a projector
There is a difference in how you start an exe file from how you start a normal file. The reason is because a exe file is self contained and it executes its self, a file like a doc or a pdf has to have a program read it, so you need to start a program to read the file and then the file.
Starting an exe
Type this in the command box: Exec
Type this in the arguments box with the expression box checked: “filename”
The file name is the name of the file you want to start, since its an exe don’t put the file extension. It must be located in the same directory as the projector to be used like this. If you are comfortable with ASCII and dos you can use relative paths to open files in other directories. If you are going to do this I would not use exact paths because your D: drive could be a CD drive, but mine is hard disk drive. The way windows is set up most people’s (99%) main hard drive is the C: drive so its ok to path it to there if you need to start a program on it.
Opening a file in its default program
Say you want to open a gif or some other type of file in its default program you would use code like this.
Type this in the command box: Exec
Type this in the arguments box with the expression box checked: “start” add chr(9) add “filename.extension”
Using this method you have to use the files extension so windows will know what program to open it up with.
Opening a file in the program you chose.
This is the fastest method of opening a file; this is because windows doesn’t have to figure out what program to use to open the file. The only concern using this is if the user has the program that you specify to open the file on their computer.
Type this in the command box: Exec
Type this in the arguments box with the expression box checked: “notepad” add chr(9) add “file.extension”
You don’t have to use a full path if you use a program that resides in the C:/windows folder. If you do want to use a program that is not in the windows folder you run a risk of the user not having the program. Below are some of the programs that most windows 9x users have in their windows folder.
Explorer… this is internet explorer the browser
Notepad… this is the basic word processor for windows
Calc… this is the windows calculator
Command… dos command prompt
Fs commands for Macintosh’s
To open browsers, files, or create documents on a Macintosh applescript is the easiest way to go. Applescript is a nifty feature included on all Macintosh's that “records” your actions and them repeats them. Open the apple extra’s folder and view the read me there and also go to
www.applescript.com/ for a full list of recordable applications. Now open the applescript program and hit record. Do a few things like open a browser and surf a few sites. Then hit stop and close your browser. Now hit play and watch the actions you did repeated. That is the basis of what apple script can be used for with projectors. Since you don’t know which browser a user has on their computer it is often better to make more than one applescript and have them control different browsers. After you get finished creating the applescripts go to file and save as. Here you want to select program from the drop down menu and check the never show start up screen button and leave the stay open button uncheck. This means the applescript will close as soon as it is done the function and not stay open in the background.
To run the applescript you need to use the Fs command. It would be feasible to launch all your applescripts at once so that the action is preformed for sure.
Type this in the command box: Exec
Type this in the arguments box with the expression box checked: “applescriptname”
In the example above applescriptname is the name of the applescript that you created. That is all you need for your projector to launch the applescript. It is recommended that you create 2 different projectors for Windows and Macintosh since some of the Fs commands are different.