passing variable to compiled script.

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
rullbandspelare
Pro Scripter
Posts: 149
Joined: Tue Mar 23, 2004 9:11 pm

passing variable to compiled script.

Post by rullbandspelare » Sat Apr 19, 2008 9:46 am

Hi!
I have this scanner program (Canoscan toolbox) that can pas its scaned PDF to an external program. But the program expect it to be passed as this:
Macro.exe scan.pdf
And as I understand it the only way to pass a variable is:
Macro.exe /Var1=scan.pdf

Any ideas on how to get the scanner to export its output to Macro scheduler???

Thanks!

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Apr 19, 2008 11:16 am

Compile the following macro:

Code: Select all

StringReplace>SCRIPT_FILE,%SCRIPT_DIR%\,,SCRIPT_FILE
StringReplace>COMMAND_LINE,%SCRIPT_FILE%%SPACE%,,PDF_FILE
MessageModal>PDF_FILE
Then run it like this:

macro.exe fred.pdf

It should display just "fred.pdf".
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts