Sign in to follow this  
Followers 0
sathish

$cmdLineRaw problem

13 posts in this topic

hello forum

I am sending a input from command line, like this:

ccc.au3 "d:\images"

while i get this input from command line inside script

$cmdLineRaw()

this returns only the first letter, say ", when i remove ", it returns only d

how to sort out this issue and how do i get the whole text inside Quotes

Share this post


Link to post
Share on other sites



We need more information to help you.

Can you post the script you have so far?

What AutoIt version do you run?

BTW: $cmdlineraw is a variable and not a function. So please use $cmdlineraw without the parenthesis.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

We need more information to help you.

Can you post the script you have so far?

What AutoIt version do you run?

BTW: $cmdlineraw is a variable and not a function. So please use $cmdlineraw without the parenthesis.

$input = $CmdLineRaw()
send ("!{TAB}")
sleep (500)
WinMenuSelectItem("[class:EQNWINCLASS]", "", "&File", "Save &As")
WinWaitActive("Save As")
ControlSend("Save As", "", "", "{" & $input & "}")

;ControlCommand ( "Save As", "&Automatic file numbering:", 20, "UNCHECK")
;ControlSend("Save As", "", "", "!t")
;sleep (100)
;ControlSend("Save As", "", "", "Graphics")
;Sleep(3000)
;If WinExists("Save As") Then
;ControlClick("Save As", "Yes", "[ID:6]")
;EndIf

This is the script i am trying to execute

Please help

Share this post


Link to post
Share on other sites

We need more information to help you.

Can you post the script you have so far?

What AutoIt version do you run?

BTW: $cmdlineraw is a variable and not a function. So please use $cmdlineraw without the parenthesis.

I tried with bracket, without bracket, $cmdline[0],$cmdline[1],$cmdline[2],

But i am getting only the first letter of the command line input, is there any unique way to run autoit exe in cmd line

now i am running like this:

>sss.exe "D:imgs"

Share this post


Link to post
Share on other sites

Insert a

MsgBox(0, "", $input)
after
$input = $CmdLineRaw()
so you can see what you get.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Insert a

MsgBox(0, "", $input)
after
$input = $CmdLineRaw()
so you can see what you get.

Thanks mate i am getting the full command line text, but what happens when i send it through

ControlSend("Save As", "", "", "{" & $input & "}")

there it sends only the first letter,

Is the syntax wrong in controlsend,

Dont mind, i am perl developer, i am learning autoit day by day slowly,

So if its a simple, please dont mind,

Anyways, thanks a lot

Edited by sathish

Share this post


Link to post
Share on other sites

Parameter 3 of your Send statement is wrong. The control-Id of the "receiving" control is needed.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Parameter 3 of your Send statement is wrong. The control-Id of the "receiving" control is needed.

I have attached the image, there is no control id for that, anyway without control id, i have Controlsend many times in some other instances, it has been working

The thing is please take a look at the image in the "File name" field,

There i need to send the $cmdlineraw value,

Now i think i have some what clearly explained my question,

Thanks in advance

Sathish V.

post-69004-0-12381900-1329473270_thumb.j

Share this post


Link to post
Share on other sites

As the input you try to send contains brackets you should set parameter 5 of the ControlSend function to "1".

The ControlID can be more than just the ID. Please check this help site.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

As the input you try to send contains brackets you should set parameter 5 of the ControlSend function to "1".

The ControlID can be more than just the ID. Please check this help site.

I am really blind now, ControlSend("Save As", "", "", "", & $input &)

The need for me is to just send the $cmdlineraw content, that brackets and all i simply tried,

say for example i am sending just "D:water" from command line, i want that to be passed in that controlsend,

Believe me, i tried and searched and googled for nearly 8 hours now, still i didn't get the solution

Thanks in Advance

Sathish V.

Could you please send me the exact Control send

Share this post


Link to post
Share on other sites

Try

ControlSend("Save As", "", "[ClassNN:#327701]", $input, 1)
MsgBox(0, "", "Error: " & @error)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Try

ControlSend("Save As", "", "[ClassNN:#327701]", $input, 1)
MsgBox(0, "", "Error: " & @error)

It works thanks mate, but i removed the [class], after that only it works fine,

Thanks a lot

Share this post


Link to post
Share on other sites

Glad to be of service :)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0