Hello Guest it is September 23, 2023, 01:15:59 PM

Author Topic: fscommand calling a vbscript  (Read 8557 times)

0 Members and 1 Guest are viewing this topic.

fscommand calling a vbscript
« on: December 13, 2011, 04:05:24 PM »
Hey there first post so be kind. I'm relatively new to flash screens and had a 2 questions.

First, ultimately I'd like to have a custom vbscript in an .m1s file that a flash button could call to perform an action. When I run it I get a "scripter compiler error. In:external macro".

In the button I have this action script:

on (release) {
fscommand("VBMacro", "EdgeQ1");

The EdgeQ1 script (just a roof of concept):

CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
MsgBox "Current Feed Rate = " & CurrentFeed

Second, sometimes I get missing file flashcodes.txt
Is there some code I need to add in the vbscript or in the action script to get this to work?
And if I'm missing this flashcodes.txt file where can I get it.

Running this on Win7 64 and mach3 Version R3.043.053 using flash 8 and flash player 11. Will try it on my xp machine for my cnc once I can get it to work.

Any help would be greatly appreciated.

Offline zealous

  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: fscommand calling a vbscript
« Reply #1 on: January 08, 2012, 07:23:37 PM »
There are 3 ways to do this:

Code: [Select]
_global.RunScript = function(the_script) {
RunScipts = 'If'+' RunScript("\\macros\\'+_root.Profile+'\\'+the_script+'") < 0 Then '+"\r"+'MsgBox "ERROR! Cannot Locate Script:'+' macros\\'+_root.Profile+'\\'+the_script+'" '+"\r"+'End If ';
fscommand("VBMacro", RunScipts);

On every button place(where LoadGCode is the name of you macro) :

Code: [Select]
on (release) {


Set the value of a var using +"\r"+ to add the return lines :

Code: [Select]
Runstart = 'If'+' RunScript("\\macros\\'+_root.Profile+'\\'+"CycleStart"+'") < 0 Then '+"\r"+'DoOEMButton(1000) '+"\r"+'End If ';
fscommand("VBMacro", Runstart);


In you will need a text box with VB code in it and name the text box for example to Edge1:

Code: [Select]
on (release) {
fscommand("VBMacro", Edge1.text);

Let me know if this helps, I can upload examples if needed.
Re: fscommand calling a vbscript
« Reply #2 on: January 10, 2012, 09:35:36 PM »
Thanks for the info I'll give it a try!!