BBardou Posted October 29, 2013 Share Posted October 29, 2013 Hello everyone, I have a script that works pretty well but sometimes (once in a hundred times) I have a very strange bug. Here are the lines where the problem appears: $var = DriveGetDrive("removable") ControlSend("Specify", "", "Edit1", $var[1] & "\" & $MyFileName & "-" & @YEAR & @MON & @MDAY & "-" & @HOUR & @MIN & @SEC) Usually I get the following path: d:MonFichier-20131028-105712 But when the bug appears I have: D/8MonFichier-20131028-105712 It is like "shift" is activated for the first part of the path. I have check the presence of special characters like '+' but nothing. I also wonder if it could come from DriveGetDrive function. Indeed in windows, drive letters appears in upper case but DriveGetDrive gives lower case. The difficulty is that this bug happens very rarely so it is hard to track it. Do you have an idea where this bug comes from? Thanks for your help Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted October 29, 2013 Moderators Solution Share Posted October 29, 2013 BBardou,Welcome to the AutoIt forum. The Send functions do seem to occasionally mess up the text string like this. I would suggest creating the filename string first and then sending it an a single variable rather than creating it "on the fly". That way you give AutoIt the best chance to read it cleanly. 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...
DatMCEyeBall Posted October 29, 2013 Share Posted October 29, 2013 Add a fifth parameter in your ControlSend call and set it to 1: [optional] Changes how "keys" is processed: flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow. flag = 1, keys are sent raw. "Just be fred, all we gotta do, just be fred." -Vocaliod "That is a Hadouken. A KAMEHAMEHA would have taken him 13 days and 54 episodes to form." - Roden Hoxha @tabhooked Clock made of cursors ♣ Desktop Widgets ♣ Water Simulation Link to comment Share on other sites More sharing options...
BBardou Posted November 4, 2013 Author Share Posted November 4, 2013 Hi, I will try all your suggestions. Thank you for your help. 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