leuce Posted April 25, 2013 Share Posted April 25, 2013 G'day everyone I have created EXE scripts in the past that worked with drag-and-drop, but I would like to create a script that can detect whether it was double-clicked or whether something was dragged and dropped onto it. How can I do that? So, what I need to do is to let the script determine if $CmdLine[1] exists or not. If it exists, the script should use the drag-and-dropped file as the first parameter, but if not, then the script should ask the user (via e.g. a FileOpenDialog) what the first parameter is. However, my problem is that I can't check if $CmdLine[0] is zero unless $CmdLine is already an array. I can't check if $CmdLine is an array unless $CmdLine already exists. However, if I declare $CmdLine, then it destroys the first parameter (if there is one). So how do I get around this problem? I would really like to make ONE script (not two) that the user can either double-click or drag-and-drop to. Thanks Samuel Link to comment Share on other sites More sharing options...
leuce Posted April 25, 2013 Author Share Posted April 25, 2013 I have created EXE scripts in the past that worked with drag-and-drop, but I would like to create a script that can detect whether it was double-clicked or whether something was dragged and dropped onto it. How can I do that? Wait... this seems to work: If $CmdLine[0] = 1 Then MsgBox (0, "", "is one", 0) EndIf If $CmdLine[0] = 0 Then MsgBox (0, "", "is none", 0) EndIf This would mean that $CmdLine is automatically always an array in any script... right? Samuel Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 25, 2013 Moderators Share Posted April 25, 2013 leuce,This would mean that $CmdLine is automatically always an array in any script... right?I believe that is correct - $CmdLine is created automatically by AutoIt as the script is launched and sized according to the actual command line passed to it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now