Jump to content

Recommended Posts

Posted

My script:

For $i = 90 to 1 Step -1

WinWaitActive("JPEG Option")

SEND("8{ENTER}")

Next

Needs a counter at least twice as big as the number of times I want it to run. In above example this script only runs on 43 files and not all 90.

If it is meaningful this script is when I am running a photoshop automate action.

Tried a few searches of forum but probably using wrong keywords as didn't find anything.

Any help appreciated.

Posted

My script:

For $i = 90 to 1 Step -1

WinWaitActive("JPEG Option")

SEND("8{ENTER}")

Next

Needs a counter at least twice as big as the number of times I want it to run. In above example this script only runs on 43 files and not all 90.

If it is meaningful this script is when I am running a photoshop automate action.

Tried a few searches of forum but probably using wrong keywords as didn't find anything.

Any help appreciated.

Is that your whole script? I'm thinking its the program that is having a problem.
Posted

I would guess that perhaps the window does not disappear or become inactive fast enough after the Send, so what's happening is it loops twice before the window disappears.

Try adding something to check if the window has closed, or changed somehow before continuing the loop. Maybe something like

For $i = 90 to 1 Step -1
  WinWaitActive("JPEG Option") 
  SEND("8{ENTER}")
  WinWaitClose("JPEG Option")
Next
Posted

I would guess that perhaps the window does not disappear or become inactive fast enough after the Send, so what's happening is it loops twice before the window disappears.

Try adding something to check if the window has closed, or changed somehow before continuing the loop. Maybe something like

For $i = 90 to 1 Step -1
  WinWaitActive("JPEG Option") 
  SEND("8{ENTER}")
  WinWaitClose("JPEG Option")
Next
Many thanks, the WinWaitClose has solved my problem. I had assumed the WinWaitActive needed a new instance.

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
  • Recently Browsing   0 members

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