Jump to content
Sign in to follow this  
batvase

edit multiple files one by one

Recommended Posts

batvase

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:

Qxp3u3Bl.jpg

Open from program:

PwXsVCOl.jpg

I hope you can understand my english.

Thanks!

Edited by batvase

Share this post


Link to post
Share on other sites
Melba23

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
batvase

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.

Share this post


Link to post
Share on other sites
JLogan3o13

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

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
batvase

 

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!

Share this post


Link to post
Share on other sites
Myicq

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.

Share this post


Link to post
Share on other sites
batvase

Myicq thank you for advise.

There is object list:

tkKkryI.jpg

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).

Share this post


Link to post
Share on other sites
Myicq

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.

Share this post


Link to post
Share on other sites
batvase

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.

Share this post


Link to post
Share on other sites
junkew

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.

Share this post


Link to post
Share on other sites
junkew

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)

Share this post


Link to post
Share on other sites
batvase

WOW!

Junkew thank you!

I will check, and will write here ( hope with success).

Share this post


Link to post
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
Sign in to follow this  

×