Sign in to follow this  
Followers 0
cenres

How to open .jpg files

3 posts in this topic

I've used autoit to automate several tasks. My latest involves resizing and saving continuous sets of pictures. Each set has 6 pictures that need to be resized to 20% of the original size. The six pictures are always named board.jpg, front2.jpg, front.jpg, inside.jpg, main.jpg, and rear.jpg. As it stands I depend on using mouse clicks to do a lot of my work. It's not reliable since the size of the window that houses the pictures could change from day to day. I'd like to be able to open the .JPG files using the path or possibley opening Microsoft Photo Editor and coding control keys to open the various pictures for resizing. It would be cleaner if I could just open the pic straight from the file like I do when I mouse click on it. Is there an easy solution for this? I don't want to waste a lot of time on this, so if it's not simple then I probably wont do it. It just wouldn't be worth the time. I'm not a programmer either, so to get someting to work takes me a lot longer to then some of you guys :) If there are any other improvements that anyone sees to make it run better, please let me know. As it sits, it runs pretty good if the window size is ok.

Opt("MouseCoordMode", 0)

;arrange icons by name
send ("!V")
send ("I")
send ("N")
sleep (300)

;resize board.JPG
mouseclick ("left", 270, 170, 1, 3)
mouseclick ("left", 270, 170, 1, 3)
sleep (1500)
send ("!I")
send ("i")
Send ("{DEL 3}")
send ("20")
send ("{Enter}")
sleep (300)
send ("!F")
send ("A")
sleep (300)
Send ("{DEL 20}")
send ("boardsm.JPG")
send ("!S")
sleep (300)
send ("!F")
send ("X")
sleep (800)

;resize front2.JPG
mouseclick ("left", 400, 170, 1, 3)
mouseclick ("left", 400, 170, 1, 3)
sleep (1500)
send ("!I")
send ("i")
Send ("{DEL 3}")
send ("20")
send ("{Enter}")
sleep (300)
send ("!F")
send ("A")
sleep (300)
Send ("{DEL 20}")
send ("front2sm.JPG")
send ("!S")
sleep (300)
send ("!F")
send ("X")
sleep (800)

;resize front.JPG
mouseclick ("left", 520, 170, 1, 3)
mouseclick ("left", 520, 170, 1, 3)
sleep (1500)
send ("!I")
send ("i")
Send ("{DEL 3}")
send ("20")
send ("{Enter}")
sleep (300)
send ("!F")
send ("A")
sleep (300)
Send ("{DEL 20}")
send ("frontsm.JPG")
send ("!S")
sleep (300)
send ("!F")
send ("X")
sleep (800)

;resize inside.JPG
mouseclick ("left", 650, 170, 1, 3)
mouseclick ("left", 650, 170, 1, 3)
sleep (1500)
send ("!I")
send ("i")
Send ("{DEL 3}")
send ("20")
send ("{Enter}")
sleep (300)
send ("!F")
send ("A")
sleep (300)
Send ("{DEL 20}")
send ("insidesm.JPG")
send ("!S")
sleep (300)
send ("!F")
send ("X")
sleep (800)

;resize main.JPG
mouseclick ("left", 270, 300, 1, 3)
mouseclick ("left", 270, 300, 1, 3)
sleep (1500)
send ("!I")
send ("i")
Send ("{DEL 3}")
send ("20")
send ("{Enter}")
sleep (300)
send ("!F")
send ("A")
sleep (300)
Send ("{DEL 20}")
send ("mainsm.JPG")
send ("!S")
sleep (300)
send ("!F")
send ("X")
sleep (800)

;resize rear.JPG
mouseclick ("left", 400, 300, 1, 3)
mouseclick ("left", 400, 300, 1, 3)
sleep (1500)
send ("!I")
send ("i")
Send ("{DEL 3}")
send ("20")
send ("{Enter}")
sleep (300)
send ("!F")
send ("A")
sleep (300)
Send ("{DEL 20}")
send ("rearsm.JPG")
send ("!S")
sleep (300)
send ("!F")
send ("X")
sleep (800)

;arrange icons by name
send ("!V")
send ("I")
send ("N")

;prepare copy
mouseclickdrag ("left", 719, 467, 274, 162)
send ("!E")
send ("C")

Share this post


Link to post
Share on other sites



Why not use a free program, like Adobe Photoshop that comes with Epson scanners? It has a BATCH SAVE function. You can pick up a folder, and re-save its contents, rename names with a numbering system and pick the file size and density. Real easy.

I have used mouseclicks a few times and ran into trouble, I would recommend using some sort of file path command instead.

Good luck. I love seeing posts like this. People that are really into it and obviously learning.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Download Irfanview from www.irfanview.com. It has lots of command line options that will let you do what you want and is free.

Edit - My 2000'th post.

Edited by BigDod


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

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  
Followers 0