In both cases, for the Mac and Windows, the button script should look like this...
on (release) {
SmartExec("CMS_1500");
}
Printable View
In both cases, for the Mac and Windows, the button script should look like this...
on (release) {
SmartExec("CMS_1500");
}
It's still not working... I'm sure I did everything you said, but I must have missed something... my fscommand folder is set up correctly and my actionscripts work...I'm guessing I messed something up with the first frame script... is this correct?
function SmartExec(target)
{
platform = $version.slice(0,3);
if (platform == "WIN")
{
fscommnd("exec", target + ".exe");
}
else
{
fscommand("exec", target + "_script");
}
}
again thank you for your patience with me
I'll email you my fla file if you get a chance take a look (email to the T.G. address)
Looks okay except for the typo "fscommnd" in the call to the WIN version. I have your files here, I'll copy them over to the old G4 and see if I can figure out what's going wrong.
I fixed the type-o and it's still not working...
NorthCode, have a great new year...thanks for all your help
This thread has been EXTREMELY helpful.
I'm having some problems implementing the fscommand method, though, and I'm wondering if anyone can help?
Northcode, I slimmed down your SmartExec() function to troubleshoot to this:
function SmartExec(target)
{
/* platform = $version.slice(0,3);
if (platform == "WIN")
{
fscommand("exec", target + ".exe");
}
else
{ */
trace('SmartExec triggered');
fscommand("exec", "test_script");
// }
}
So I know the function is running thanks to the trace() but it still won't run the test_script.
According to this script, 'test_script' should just be an executable Applescript application located in the same directory as the .swf calling it right?
The Applescript works by itself, so somethingmust be wrong with how I'm calling it in Flash...
Help?? Thanks!
The EXEC fscommand only works in projectors (not SWFs) and the thing you want to exec has to be in a folder called "fscommand".
oooohh. ok. thanks!
wait though, i did as prescribed but it still won't work..
i've got the function running successfully in the projector, and the 'test_script' residing in a folder at the same level as the projector called 'fscommand', but still the Applescript doesn't execute when the function is run...
Any other ideas?
Compile the AppleScript to an application OR rename the script to test_script.scpt and change the EXEC function to use the name with the extension.
I get a syntax error in the Actionscript debugger telling me that there's no slice() method, when I try to publish the projector.
Does that statement really work?
Thanks, Northcode. I added the .scpt extension to the file and the Mac automatically renamed it:
test_script.scpt.app
this did the trick after changing the name respecitively in the Actionscript...
Thanks!
OK, so there must be something wrong with the SmartExec() as written.
I get the error upon publishing complaining about the slice() method, and if I comment out that variable assignment, the script runs properly...
Any help there?
PS, it's been a GREAT help that you took the time to do all of this work for shmos like me.
Try replacing this line from the original script
platform = $version.slice(0,3);
with this one which will work with more versions of Flash
platform = substring($version,0,3);
AND/OR make sure that the SmartExec function is at the root of your movie or $version won't exist. So you can also try using _root.$version in place of $version (if the substring trick doesn't work).
Thanks Northcode, I'm going to try this fix as soon as I get a second.
you're prescribed solution did the trick.
thanks, northcode
-s
Hey Northcode, it's your old friend MacArtist... you had created .bat and .exe files for me to open PDFs off CD-Roms... I need to change the names of the PDFs, what program can I edit the .bat and .exe files in?
Thank you again.
Hi Nothcode, I've attached a copy of one of the files you made for me... I was thinking I should simply name my PDFs "01.pdf", "02.pdf", "03.pdf" etc...
Then I could use these as my templates... what's your thoughts?
You don't need to edit the EXE files, just make copies of CMS_1500.exe and rename the copies to 01.exe, 02.exe, etc. You'll need to make copies of the BAT files, rename them the same way and edit the name of the PDF file inside the BAT file to match. The BAT files are really just text files so you can edit them with notepad or any editor that just saves as plain text.
worked like a charm... you're the best
hi there :)
I tried to follow this tut of yours, but in the end I can´t manage it to work...
I followed all the steps you said but when I clik the button it doesn´t do any thing...
I´m wondering if I can send you my files?! I´m really stuck on this....
Hope you can help...:)
Quote:
Originally Posted by Northcode
some days before i have this problem too. but now i have solution.
first of all make batch file of any pdf or word doc file.
ENTER this code in notepad:
@ECHO OFF
filename.extension
EXIT
then save as mypdf.bat
here filename is ur pdf or word document file name and there extension e.g one.pdf or one.doc
now place this file with pdf or word doc file in folder named "fscommand"
in flash write a code on button
on (release){
fscommand ("exec","mypdf.bat");
}
and make projector file (.exe) of this flash movie
now remember both ur fscommand folder and ur projector are on same place.
run the projector and click on button
then u will see that u r successful