Use Ctrl + v to Paste to Your Dialog

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

daa5417
Newbie
Posts: 10
Joined: Sun Dec 30, 2012 3:56 am
Location: New Orleans, LA

Post by daa5417 » Mon Dec 31, 2012 6:44 am

CyberCitizen wrote:
daa5417 wrote:at my job we fix them, so the source doesn't really matter.
Same
daa5417 wrote:Renaming it in the explorer and then opening it in Paint would be kind of backwards. It's not a better process than the current one.
This was purely to see if it needs to be a *.jpeg extension or if its just a way of telling mspaint to update the image.
daa5417 wrote:I'm not trying to figure out what's wrong. I just want to write a macro that does what I explained in my original post.
See thats where im different I want to know why its broken so I can provide a better fix / solution.

That being said, download PhotoResize.exe http://www.rw-designer.com/picture-resize

Rename the executable to PhotoResizeP100IOEQ100.exe

Select all the images & then drag and drop them onto the exe. Note this will re-save the images (overwriting the originals) with the same dimensions its not actually doing anything resize wise, just re-saving them.

If that works for your program then we can look at using a macro and calling the folder to be done via a batch.
No, using the PhotoResize program didn't work. Unless you by chance have knowledge of Autodesk Maya, I don't know if you'll be able to figure out the problem. That's why I'm not worrying about figuring out what's causing it. After 5+ years of having this error, there have only been one or two forums that come up with the solution in Maya. So I don't think that bodes well for figuring out what causes it.
D. Anderson

daa5417
Newbie
Posts: 10
Joined: Sun Dec 30, 2012 3:56 am
Location: New Orleans, LA

Post by daa5417 » Mon Dec 31, 2012 6:46 am

CyberCitizen wrote:Hi Deb,

That is because the script JRL wrote is only looking for *.jpg files to re-save as *.jpeg files. Your now talking about a png file.

Is there more than one file type?
There are no PNG files in the folder, which is why it's weird that the error is coming up. I don't know how I can mess up the script between copying and pasting it and pressing execute, but it's possible. All the images in the folder are jpegs.
D. Anderson

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Mon Dec 31, 2012 6:50 am

Don't suppose you could provide an original test image that I can use to script and then I can send it back and you can see if it can be imported.
FIREFIGHTER

daa5417
Newbie
Posts: 10
Joined: Sun Dec 30, 2012 3:56 am
Location: New Orleans, LA

Post by daa5417 » Mon Dec 31, 2012 6:54 am

CyberCitizen wrote:Don't suppose you could provide an original test image that I can use to script and then I can send it back and you can see if it can be imported.
Here's one http://imgur.com/0bBur
D. Anderson

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Mon Dec 31, 2012 6:54 am

So are the images coming from AutoDesk or your trying to import them into AutoDesk?
FIREFIGHTER

daa5417
Newbie
Posts: 10
Joined: Sun Dec 30, 2012 3:56 am
Location: New Orleans, LA

Post by daa5417 » Mon Dec 31, 2012 6:56 am

CyberCitizen wrote:So are the images coming from AutoDesk or your trying to import them into AutoDesk?
The images are coming from an artist. Autodesk Maya is one of the 3D programs I use at work.
D. Anderson

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Mon Dec 31, 2012 7:02 am

Can you try this one?

http://imgur.com/Qhox7

I have to head home for the day, but can have a look when I get home.
FIREFIGHTER

daa5417
Newbie
Posts: 10
Joined: Sun Dec 30, 2012 3:56 am
Location: New Orleans, LA

Post by daa5417 » Mon Dec 31, 2012 7:19 am

CyberCitizen wrote:Also check out http://lifehacker.com/342308/batch-conv ... age-magick

This will allow you to batch convert images as well, might be another solution if PhotoResize doesn't work for you.
This option worked. I hope it still works when I get to work on Wednesday.
D. Anderson

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Tue Jan 01, 2013 8:09 am

Excellent, If That Did It For You We Should Be Able To Create A Script That Uses That Program And Converts All Images In A Folder.
FIREFIGHTER

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jan 02, 2013 5:56 am

Sounds like you've about got this resolved but here's another thought. If the files are all desktop size or smaller you could display them individually on a dialog (assuming they will display) then use ScreenCapture> to save them to new jpg files.

This script creates a folder named "New_Image_Folder" in the temp directory and saves the imaged there.

Code: Select all

Dialog>Dialog1
object Dialog1: TForm
  BorderStyle = bsNone
  AutoSize = true
  object MSImage1: tMSImage
    Left = 0
    Top = 0
    AutoSize = true
  end
end
EndDialog>Dialog1

CreateDir>%temp_dir%New_Image_Folder

Let>INPUT_BROWSE=2
InPut>vfolder,Select the folder where the jpgs live.

GetFileList>%vfolder%\*.jpg,vList,;
Separate>vList,;,vFile

Show>Dialog1

Let>kk=0
Repeat>kk
  Add>kk,1
  Let>value=vFile_%kk%
  ExtractFileName>value,vFileName
  ExtractFilePath>value,vPathName
  ExtractFileExt>value,vFileExt
  StringReplace>vFileName,vFileExt,,vFileName
  SetDialogProperty>Dialog1,MSImage1,LoadImage,%vPathName%\%vFileName%.jpg
  Let>WIN_USEHANDLE=1
    ResizeWindow>Dialog1.handle,0,0
    MoveWindow>Dialog1.handle,0,0
    GetWindowSize>Dialog1.handle,WinX,WinY
  Let>WIN_USEHANDLE=1
  ScreenCapture>0,0,WinX,WinY,%temp_dir%New_Image_Folder\%vFileName%.jpg
Until>kk=vFile_Count

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts