Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Newbie's first question (window titles)


  • Please log in to reply
5 replies to this topic
jerrypettit
  • Members
  • 6 posts
  • Last active: Jan 19 2014 08:19 PM
  • Joined: 27 Jul 2009
I've written my first successful AHK program that uses a program called Sound Forge to extract certain regions of an audio file as WAV files, then uses CDex to convert the WAV files to MP3s.

Works perfectly.

EXCEPT...it only works on one file. And I would like it to work "universally". I suspect what needs to be changed is the name of the Window which is now "Sony Sound Forge 7.0 - [Japanese I - Lesson 5*]"

Obviously the Japanese file in the brackets needs to be changed to accept whatever file is open in Sound Forge. How does one do that? (And by the way--what is that asterisk after Lesson 5* for?)

Here's the program which DOES WORK, but only on Lesson 5 (as recorded by AutoScriptWriter, then manipulated after spending an hour and a half scratching my head and trying different things):

;EXTRACTS THE AUDIO REGIONS VIA SOUND FORGE
WinWait, Sony Sound Forge 7.0 - [Japanese I - Lesson 05 *], 
IfWinNotActive, Sony Sound Forge - [Japanese I - Lesson 05 *], , WinActivate, 

Sony Sound Forge 7.0 - [Japanese I - Lesson 05 *], 
WinWaitActive, Sony Sound Forge 7.0 - [Japanese I - Lesson 05 *], 
MouseClick, left,  158,  36
Sleep, 100
WinWait, Sony Sound Forge 7.0, 
IfWinNotActive, Sony Sound Forge 7.0, , WinActivate, Sony Sound Forge 7.0, 
WinWaitActive, Sony Sound Forge 7.0, 
MouseClick, left,  299,  145
Sleep, 100
WinWait, Sony Sound Forge 7.0 - [Japanese I - Lesson 05 *], 
IfWinNotActive, Sony Sound Forge 7.0 - [Japanese I - Lesson 05 *], , WinActivate, 

Sony Sound Forge 7.0 - [Japanese I - Lesson 05 *], 
WinWaitActive, Sony Sound Forge 7.0 - [Japanese I - Lesson 05 *], 
MouseClick, left,  361,  12
Sleep, 100
Send, {ALTDOWN}t{ALTUP}x{ENTER}
WinWait, Sony Sound Forge 7.0, 
IfWinNotActive, Sony Sound Forge 7.0, , WinActivate, Sony Sound Forge 7.0, 
WinWaitActive, Sony Sound Forge 7.0, 
Sleep, 15000
;CONVERTS WAV FILES TO MP3 VIA CDex
WinWait, CDex Version 1.51, 
IfWinNotActive, CDex Version 1.51, , WinActivate, CDex Version 1.51, 
WinWaitActive, CDex Version 1.51, 
MouseClick, left,  122,  15
Sleep, 100
MouseClick, left,  115,  38
MouseClick, left,  115,  38
Sleep, 100
MouseClick, left,  142,  156
MouseClick, left,  142,  156
Sleep, 100
WinWait, Open, 
IfWinNotActive, Open, , WinActivate, Open, 
WinWaitActive, Open, 
MouseClick, left,  176,  341
MouseClick, left,  176,  341
Sleep, 100
MouseClick, left,  329,  343
Sleep, 100


Thanks in advance for any help!

Jerry

[Title edited. Please write descriptive titles for your topics. ~jaco0646]

AnttiV
  • Members
  • 237 posts
  • Last active: Feb 13 2014 02:31 PM
  • Joined: 14 Aug 2009
Set every "Sony Sound Forge 7.0 - [Japanese I - Lesson 5*]" tp "Sony Sound Forge 7.0" and then set TitleMatchMode (check the docs)

EDIT: Link - http://www.autohotke...leMatchMode.htm

jerrypettit
  • Members
  • 6 posts
  • Last active: Jan 19 2014 08:19 PM
  • Joined: 27 Jul 2009
Thanks a million for the quick response!

Jerry

jerrypettit
  • Members
  • 6 posts
  • Last active: Jan 19 2014 08:19 PM
  • Joined: 27 Jul 2009
Well, I spoke too soon.

I'm clueless, even after reading the documentation you've linked to (and others referenced THERE).

I tried putting this in as the first line (after deleting the reference to the Japanese file):

SetTitleMatchMode, 1, RegEx(Sony)

And various permutations of that, with no understanding of what I'm doing.

This is my first programming venture EVER...so, like I say, I'm pretty clueless as to how to actually Set that TitleMatchMode...

AnttiV
  • Members
  • 237 posts
  • Last active: Feb 13 2014 02:31 PM
  • Joined: 14 Aug 2009
Just put
SetTitleMatchMode, 1
and leave the rest of the line off. It should match all windows that start with the "Sony..." that you specify everywhere.

jerrypettit
  • Members
  • 6 posts
  • Last active: Jan 19 2014 08:19 PM
  • Joined: 27 Jul 2009
Thanks very much!