Jump to content

NewMem-Howto"Save-As"


Recommended Posts

New to this (but not to programming) Win 2000pro, I'm scanning a huge amount of photos with a HP simple scanner and I want to automate the process by selecting the "Save-As" in the HP software window and saving each scan as the same type (.tif) and doc name + (integer 1), all with hitting one "hot-key." Any ideas of scripts that are available?

Thanks

Link to comment
Share on other sites

Read in help file about WinMenuSelectItem() to click Save as in your software menu and ControlSend() to set name of file and ControlClick() to press save button. I don't know how look your software but an example could help you:

Opt("WinTitleMatchMode",2) ;This is used when you don't know or don't want to type full name of windows.
Run("notepad.exe") ;Run notepad
WinWait("Notepad") ;Wait for notepad window

For $INDEX = 1 To 5 ; start of for loop (from 1 to 5)
WinMenuSelectItem("Notepad","","&File","Save &As...") ;click on save as menu item
WinWait("Save As","Save &in:") ;wait for Save As window
ControlSetText("Save As","Save &in:","Edit1","File_" & $INDEX) ;Set the name of saved file
ControlCommand("Save As","Save &in:","ComboBox3","SelectString","Text Documents (*.txt)") ;Set type of file to save from combo control
ControlClick("Save As","Save &in:","Button2") ;Click on save as button
Sleep(2000) ;wait 2 seconds
Next ;go in the start of loop with next index (if index = 5 then continue script)
WinClose("Notepad") ;close notepad
Edited by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

I must digest this first. It loks like this script will open and close otepad everytime? I would like to keep the program open and just hit "save-as" and set the file name (name+1),type (.tif) and location (same). Can you post comments at each line? I don't understand "sleep 2000"

Thanks

Link to comment
Share on other sites

No man, script do not open notepad every time. There is a for loop. Is just an example of saving with notepad 5 diferent files names. I will put the comments.

Edited by Andreik

When the words fail... music speaks.

Link to comment
Share on other sites

Ahh, yes. This looks good. I will work with this today, and see what I can get from it. The trick is the HP program wants to scan after "save-as" so I must provide a space in this script to pause for user input (i.e. changing the photo to be scanned each time)

This is very cool. Thanks you Very Much!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...