Jump to content

Pass Args?


Guest KJake
 Share

Recommended Posts

AutoIt accepts command-line arguments separated by spaces. (The length of the command line is limited by the Windows platform and may be as little as 256 and as large as 1024 characters.)

You can create a shortcut to the script then edit its properties to include arguments.

Here's an example:

; Put compiled version in the Send To menu
;   and it copies selected file path(s) to clipboard

If $CmdLine[0] > 0 Then
  $tmp = ""
  For $i = 1 to $CmdLine[0]
    $tmp = $tmp & $CmdLine[$i] & @CRLF
  Next
  ClipPut( StringTrimRight($tmp,2) )
EndIf

The special array $CmdLine[0] contains the number of elements (command-line arguments), $CmdLine[1] would contain the first element, etc.

Post back if you need more detail.

Edited by CyberSlug
Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Tab is also a separating character.

But take care of the quote is submitted

by Run(@programfilesdir & '\AutoIt3\Autoit3.exe /c anystatements')

I face this problem. I don't completely rememebr but quoting was a problem to manage.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...