batvase Posted August 14, 2013 Share Posted August 14, 2013 (edited) Hello! I read this forum for a while and find many answers, but now I have to register to ask help. So, I have a program for barcode generation, with huge number of files (about 5000+). Last week I reinstalled my windows, and barcode printer lost it's settings. The only way now is to modify these files one by one. I mean to open program that edit *.lab file, make some changes, and when all is done to close the program, when it ask to write modified file to answer with "yes". All manipulations with mouse and keys I can make, but don't know how to open files one by one with diferent names. I need every time to open the file from folder, not by program dialog because when it opens like that, dialog windows arranged with cascade style, and thats changed position of click. Open from folder: Open from program: I hope you can understand my english. Thanks! Edited August 14, 2013 by batvase Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 14, 2013 Moderators Share Posted August 14, 2013 batvase,Welcome to the AutoIt forum. If all the files are in the same folder, then you can list them using _FileListToArray - if they are scattered throughout the tree then my _RecFileListToArray UDF will do the trick. Then I suggest using ShellExecuteWait on each of the files in turn - if they are associated with the app you use they should open in it and you can modify them as required. But judging from your "changed position of click" comment I imagine that you are using simple "MouseClick" commands. I would look to using Control* commands - they are much more reliable and do not depend on screen position. 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...
batvase Posted August 14, 2013 Author Share Posted August 14, 2013 Thank you for fast reply. Yes all files are in the same directory, and I must use mouse click because that is the only way to reach "properties" of barcode and to make changes. I used Autoit to launch some programs at startup (they need user name and password to function), so that was simple scripts. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted August 14, 2013 Moderators Share Posted August 14, 2013 Can you give an example of step by step what you need to do to modify the file? We can probably assist you in getting away from the unreliable mouse clicks. Something like this will help us assist you: Open File Click File Click Properties etc. etc. Save File Close "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
batvase Posted August 15, 2013 Author Share Posted August 15, 2013 JLogan3o13 I will be grateful for any help! 1. open file 2. right click over barcode 3. left click over properties (P short key) 4. send {tab} 5. send 2 (adjust barcode height) 6. send {enter} (OK button, edit complete) 7. send alt+F4 (close program) 8. send {enter} (OK button, the program ask to save the file) 9. open next file I'm not sure how to open next file. Thanks! Link to comment Share on other sites More sharing options...
Myicq Posted August 19, 2013 Share Posted August 19, 2013 Batvase, I have sucessfully automated LabelView 10, a much newer product but still from Teklynx. Task: extract all object properties to XML. [rant] It would be SO much nicer if Teklynx were'nt so arrogant and supplied a decent COM interface. Their software is so close-up that once you have your data in their application, nothing can get them out again except as an image. Yes, they won't even export to another of their products [CodeSoft] against payment. [/rant] LV10 was simple because it has an object tree I could traverse. Your situation may be different, not sure if you can get to an object list ? If not, is your barcode in same position always ? You could perhaps move the child window to known coordinates. Or maximise it ? Let me know if I can help in any way. I am just a hobby programmer, and nothing great to publish right now. Link to comment Share on other sites More sharing options...
batvase Posted August 20, 2013 Author Share Posted August 20, 2013 Myicq thank you for advise. There is object list: But I can't change anything there (maybe because it is free version). Yes, barcode is always in same position, but the child window can only be maximised by mouse ( alt+space+x maximises parent window). Link to comment Share on other sites More sharing options...
Myicq Posted August 24, 2013 Share Posted August 24, 2013 This is in principle what I did to extract data from a label software: Open application Grab a list of files into array Send keystrokes to open a file Focus on object list. This was in my case a treeview I could interact with Double Click objects one by one Extract content from property window that opens (I could simply read all window text). The property window was an unknown tab page control but could be navigated using Ctrl-Tab Close property window When no more objects, close file So I did not have to worry about object placement or maximising the child window. In your case, how do you get to properties of an object ? Would be happy to post some example code here. I can't post all of it, as I sold the solution to a customer. I am just a hobby programmer, and nothing great to publish right now. Link to comment Share on other sites More sharing options...
batvase Posted September 9, 2013 Author Share Posted September 9, 2013 Hi Myicq, I was on vacantion. Thank you again for helping me. I will be great if you post some examples, especialy with list of files to array. The only way to get properties of the file is with right click with mouse over barcode. But if I use ctrl+x to close property window, next file will be a little to right position, and thats make dificult to oprate with it. That's why I need to open the application every time. Link to comment Share on other sites More sharing options...
junkew Posted September 9, 2013 Share Posted September 9, 2013 Can you check the .LAB file in an (hex) editor. Maybe its a text format which easily can be edited For sure you can click the maximize window button with a controlclick command or a little more complex is to use this '?do=embed' frameborder='0' data-embedContent>> What is Au3INF.EXE showing when you hover over the controls like maximize/minimize etc. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
junkew Posted September 9, 2013 Share Posted September 9, 2013 I checked by downloading your tool labelshop from here http://www.intermec.info/software/labelshop-intermec-etiket-design-software/intermec-labelshop-downloads.html Tough as this is not recognizable [CLASS:Afx:400000:8:10003:10:0; INSTANCE:4] this can help '?do=embed' frameborder='0' data-embedContent> title=""> as you know get access to the min,max, close buttons But probably this code will put you in the right direction with the help file of AutoIT Local $handle = WinGetHandle("[CLASS:CodesoftWndClass]") Winactivate("[CLASS:CodesoftWndClass]") Local $Title = WinGetTitle("[active]") Opt("WinSearchChildren", 1) ;0=no, 1=search children also ;~ Find a list of windows that ends with .lab Local $var = WinList("[REGEXPTITLE:.*\.Lab]") ;~ maximize them first window is overall Labelshop window winactivate($var[2][0]) $pos=wingetpos($var[2][0]) mousemove($pos[0]+$pos[2]-60,$pos[1]+10) mouseclick("left") sleep(500) ; Shows the filenames of all files in the current directory. Local $search = FileFindFirstFile("*.lab") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 Local $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileClose($search) FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
batvase Posted September 10, 2013 Author Share Posted September 10, 2013 WOW! Junkew thank you! I will check, and will write here ( hope with success). 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