| View previous topic :: View next topic |
| Author |
Message |
dncarac
Joined: 31 Aug 2006 Posts: 60
|
Posted: Tue Jan 23, 2007 4:39 pm Post subject: Script responsive to command line AND drag&drop |
|
|
I've found script examples here and in the help for drag and drop, or for command line parameters.
Is there a way to make a single script work with both? That would enable use of the command line for file associations and drag and drop for GUIs.
Does that make sense to anyone?
Dave |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1202 Location: USA
|
Posted: Tue Jan 23, 2007 5:53 pm Post subject: |
|
|
| Quote: | make sense to anyone?
|
yep |
|
| Back to top |
|
 |
Lemming
Joined: 20 Dec 2005 Posts: 150 Location: Malaysia
|
Posted: Wed Jul 04, 2007 5:41 pm Post subject: |
|
|
something like this?
| Code: | if 0 < 1 ; The left side of a non-expression if-statement is always the name of a variable.
{
MsgBox Fancy GUI launched because there were no command line params
ExitApp
}
Else
{
MsgBox Looks like you entered %1% as the first param`n`nNO GUI FOR YOU!
ExitApp
} |
http://www.autohotkey.com/docs/Scripts.htm#cmd |
|
| Back to top |
|
 |
Helpy Guest
|
Posted: Wed Jul 04, 2007 5:56 pm Post subject: |
|
|
That's the same thing, drag'n'dropping a file on a script is running this script with the file path as parameter. Except that's the short path, you have to do an extra step to get the long path.
Example that work even if no file is given:
| Code: | If 0 = 1 ; Strange looking, no? :)
{
Loop %1% ; Avoid short name
{
filePath := A_LoopFileLongPath
}
}
Else
{
FileSelectFile filePath, 1
}
MsgBox %filePath%
|
|
|
| Back to top |
|
 |
|