Hello. I have written a macro to automate the opening, resizing, and saving of files from a directory. All saved files must be no larger than 350pxx350px. I can get it to automate, but since some pictures are wider than tall, and others taller than wide, some end up too large. I cannot get the macro to recognize the width and height fields in the PhotoDraw resize dialogue box as something to compare so that I can use an IF command. Here is the macro:
Press Down
Wait>1.13
Press Enter
WaitWindowOpen>Microsoft Photodraw(picname here)
MoveWindow>MIcrosoft Photodraw -(pic name here)
ResizeWindow>Microsoft Photodraw - (pic name here)
Wait>9.11
Press ALT
Wait>0.03
Send>z
Wait>0.16
Release ALT
Wait>2.98
Send>r
Wait>2.52
If>Width>Height,gotowidth
Goto>height
Label>gotowidth
SRT>gotowidth
Press Tab
Goto>gotoend
END>gotowidth
Label>gotoheight
SRT>gotoheight
Press Tab * 2
Wait>1.05
END>gotoheight
Label>gotoend
Send Character/Text>350
Wait>1Press Enter
WaitL>2.61
Press ALT
Send>a
Press Enter
WaitWindowOpen>Microsoft Photodraw(file name here)
MoveWindow>Microsoft PhotoDraw - (file name here)
ResizeWindow>Microsoft PhotoDraw - (file name here_
Wait>3.72
Press Tab * 3
Wait>1.88
Press ENter
Wait>2.04
Press Enter
WaitWindowOpen>Save for Use In Wizard
MoveWindow>Save for Use In Wizare,(numbers here)
ResizeWindow>Save for Use In Wizard,(numbers here)
Wait>1.194
Press Enter
WaitWindowOpen>Save As
MoveWindow>Save As,212,160
ResizeWindow>Save As,599,392
Wait>0.22
WaitWindowOpen>Microsoft PhotoDraw(file name here)
MoveWindow>Microsoft PhotoDraw - (file name here)
ResizeWindow>Microsoft PhotoDraw - (file name here_
Wait>2.37
Later I'll set it to repeat, but first I have to get it to recognize the width and height fields in PhotoDraw: (If>Width>Height,gotowidth)
Can anyone help me figure out what those boxes would be designated as so I can resize all 4000 pics while I sleep?
Thanks!
Can't get macro to recognize PhotoDraw field
Moderators: Dorian (MJT support), JRL
Can't get macro to recognize PhotoDraw field
R. Manak
Manak Enterprises
Manak Enterprises
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
I don't use PhotoDraw, but can't you get these size values from some Property source? Maybe use another program to get the size properties, and use them as necessary in PhotoDraw?
If I open a JPG file in Netscpe, then look at View, Page Info, the first line gives me the dimensions. Here is an example:
JPEG image 1168x1022 pixels has the following structure:
Now that line could be parsed to extract the 1168 and 1022 to be used in other applications. The values can be modified by multiplying by some factor, can be saved as variables or as clipboard values to be pasted in to some field in another program, etc.
Just an idea, maybe a workaround until a PhotoDraw person shows up here.
If I open a JPG file in Netscpe, then look at View, Page Info, the first line gives me the dimensions. Here is an example:
JPEG image 1168x1022 pixels has the following structure:
Now that line could be parsed to extract the 1168 and 1022 to be used in other applications. The values can be modified by multiplying by some factor, can be saved as variables or as clipboard values to be pasted in to some field in another program, etc.
Just an idea, maybe a workaround until a PhotoDraw person shows up here.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
Thank you for the reply! Unfortunately, though I think I might have sort of tried what you say, I don't really know this language, i'm teaching myself, and I'm not sure what parsing is, how it is done, etc. I looked in help and couldn't find it. I did, at least, manage to find a pretty quick way to sort the files manually, so then I wrote one macro to sort the folder of height > width, one to sort the folder of width > height, and one to sort the folder of height = width. I'd still like to understand parsing, if you don't mind. But if you don't have the time, I'll perfectly understand. Thanks so much for your response!
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
Hello Guest:
You wrote:
http://www.mjtnet.com/usergroup/viewtopic.php?t=629
You wrote:
I thought that should be a separate topic so I submitted Parsing a Line Sample here:I'd still like to understand parsing, if you don't mind.
http://www.mjtnet.com/usergroup/viewtopic.php?t=629
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!
To manipulte images is a little tricky, isn't it?
If the image won't meet the expected scale (eg. it's to small) you have to expand it (---> "How to become a cone head" ).
So, if you have to do a batch conversion, there are several tools arround (maybe PhotoDraw has that option!).
Here are just a few examples of what ImageMagick can do:
Convert an image from one format to another (e.g. TIFF to JPEG)
Resize, rotate, sharpen, color reduce, or add special effects to an image
Create a montage of image thumbnails
Create a transparent image suitable for use on the Web
Turn a group of images into a GIF animation sequence
Create a composite image by combining several separate images
Draw shapes or text on an image
Decorate an image with a border or frame
Describe the format and characteristics of an image
ImageMagick is available for free! more...
If the image won't meet the expected scale (eg. it's to small) you have to expand it (---> "How to become a cone head" ).
So, if you have to do a batch conversion, there are several tools arround (maybe PhotoDraw has that option!).
Here are just a few examples of what ImageMagick can do:
Convert an image from one format to another (e.g. TIFF to JPEG)
Resize, rotate, sharpen, color reduce, or add special effects to an image
Create a montage of image thumbnails
Create a transparent image suitable for use on the Web
Turn a group of images into a GIF animation sequence
Create a composite image by combining several separate images
Draw shapes or text on an image
Decorate an image with a border or frame
Describe the format and characteristics of an image
ImageMagick is available for free! more...
Thanks everyone - I don't know why it thinks I'm a guest
Thank you very much everyone for your responses! I really appreciate the helpful nature of this forum. All of the advice has actually helped me a lot, and now I'm working on scripts 3 & 4, so far I have had two Dell's running 1 & 2 (each a different macro to perform a different action on different files) all night last night and the night before, and have consequently saved my business more than 32 hours work so far! This program is awesome and you are all very helpful.
I will also continue to look at the parsing post, which I really appreciate, but it's still over my head. I'll have to work with it a lot before I understand all those variables, but I think it will be a great boon to have that for reference.
Also, I have saved ImageMagick to my favorites and will be looking more in-depth at it soon.
Again, thanks to everyone for helping me out here!!!
R. Manak
I will also continue to look at the parsing post, which I really appreciate, but it's still over my head. I'll have to work with it a lot before I understand all those variables, but I think it will be a great boon to have that for reference.
Also, I have saved ImageMagick to my favorites and will be looking more in-depth at it soon.
Again, thanks to everyone for helping me out here!!!
R. Manak