Jump to content

Any easy way to generate some code for a script?


tp9191
 Share

Recommended Posts

Ugh. Such an easy mistake. I can't believe I overlooked that since even the help file showed the quotes needed around the control ID.

Thanks I wil try that, but, on another note, is there anywhere I can see what all the colors mean? That will help me in the future.

Link to comment
Share on other sites

I'm used to the old colour scheme, so I'm still on a learning curve since I don't write all that much code anymore. Can't exactly send your computer out to chase down that dog on the street.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Haha... what?

Anyway the '30' values that you had put at the end of the WinActive lines, those are the timeouts, correct?

Because I was getting it confused with the While $n < 30 near the top of the script, since there is a 30 there, too.

With the way you had 'noodled' around with the script, which way am I supposed to be following as far as the selecting the file goes? Sending down key presses, or having it type in the filename into the box?

The former would be easier, but the 2nd would require additional lines added and would be tougher if the filenames aren't 1,2,3,4,etc .flv?

Link to comment
Share on other sites

So I decided to go back to my original script, rather than the one you worked on because I need to get this done sooner, rather than later.

My god I was making the loop statements unnecessarily more difficult than it should've been. LOL I finally found something that works though.

Global $n

Opt("MouseCoordMode", 0 )

Do

WinActivate("[Class:WindowsForms10.window.8.app.0.2e0c681]")
ControlSend("Replay Media Catcher 4", "", "[NAME:menuStrip]", "!tf")
WinWait ("Select FLV file to fix ...")

ControlClick ("Select FLV file to fix ...", "", "[CLASS:DirectUIHWND; INSTANCE:2]", "", "1", 50,40)
Sleep (500) ;; only keeping these in here so I can see what is going on
ControlSend ("Select FLV file to fix ...", "", "[CLASS:DirectUIHWND; INSTANCE:2]", "{DOWN " &$n& "}")
Sleep (500)
ControlSend("Select FLV file to fix ...", "", "[CLASS:DirectUIHWND; INSTANCE:2]", "{enter}")
Sleep (500)

WinWaitActive ("Fix FLV", "Actual File Duration") ;; should i keep this in here?
ControlClick ("Fix FLV", "", "File Contents")
Sleep (500)
WinWaitActive ("Fix FLV", "Displaying the first")
ControlClick ("Fix FLV", "", "Fix Time")
Sleep (500)
ControlSend ("Are you sure?", "", "[NAME:movablePanel]", "{enter}")

WinActivate ("Fix FLV", "Displaying the first")
ControlClick ("Fix FLV", "", "Close")

$n = $n + 1

Until $n = 5

Do I really need WinWaitActive? Is the script any less failproof than if I left them in there? I noticed when I processed larger files, the UI seems to lag a bit more and wouldn't send {enter} keys (or whatever else) sometimes. But this was back in the earlier scripts when I was using Send as opposed to ControlSend now.

So far this script seems satisifactory to me, and at least it finally works :)

I will use your method once I learn how exactly i'm going to use it, and learn some more stuff.

EDIT: I don't know why my script isn't nesting neatly, sorry.

Edited by tp9191
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...