Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 6:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: How send parameters to AutoIt application?
PostPosted: May 16th, 2009, 1:26 pm 
Offline

Joined: March 4th, 2007, 7:17 pm
Posts: 132
I use in my publication Opus + AutoIt. Want to send the value of several variables. While in the head only to Opus write data to a text file in the lines, but AutoIt app read them. :roll:

_________________
Opus Pro 5.5
Win XP


Top
 Profile  
 
 Post subject:
PostPosted: May 20th, 2009, 3:05 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I am not sure if this will work?? but look at the CmdLine in Autoit.

from the help file:---------------------------------------------------
Command Line Parameters
The special array $CmdLine is initialized with the command line parameters passed in to your AutoIt script. Note the scriptname is not classed as a parameter; get this information with @ScriptName instead. A parameter that contains spaces must be surrounded by "double quotes". Compiled scripts accept command line parameters in the same way.

$CmdLine[0] is number of parameters
$CmdLine[1] is param 1 (after the script name)
$CmdLine[2] is param 2 etc
...
$CmdLine[$CmdLine[0]] is one way to get the last parameter...



So if your script is run like this:

AutoIt3.exe myscript.au3 param1 "this is another param"

$CmdLine[0] equals... 2

$CmdLine[1] equals... param1

$CmdLine[2] equals... this is another param

@ScriptName equals... myscript.au3



In addition to $CmdLine there is a variable called $CmdLineRaw that contains the entire command line unsplit, so for the above example:

$CmdLineRaw equals... myscript.au3 param1 "this is another param"



If the script was compiled it would have been run like this:

myscript.exe param1 "this is another param"

$CmdLineRaw equals... param1 "this is another param"

Note that $CmdLineRaw just return the parameters.



Note : only 63 parameters can be return by $CmdLine[...], but $CmdLineRaw will always returns the entire command line.
----------------------------------------------------

So in Opus you would run the 'myscript.exe' and have param1 and param2 passed in from Opus.
In Autoit, $CmdLine[1] would give you param1 and $CmdLine[2] would give you param2
But I haven't tried it.

Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: May 20th, 2009, 3:22 pm 
Offline

Joined: March 4th, 2007, 7:17 pm
Posts: 132
Thanks you, sandyn.
As something to try to understand this:)
In the meantime, I just write the variable to a text file, then reads the variable to AutoIt and immediately remove:)

_________________
Opus Pro 5.5
Win XP


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group