Set Application Focus problem  SOLVED

User-to-User discussion about the PhraseExpress macro programming.
Post Reply
Andy S
Posts: 14
Joined: 01 May 14, 16:12

Set Application Focus problem  SOLVED

Post by Andy S » 26 Mar 20, 11:22

Hi, I have .txt file open on my desktop, and I have been using a few phrases (triggered via stream deck) which insert text into the .txt file (notepad.exe) open window. I have one that inserts the current time, and a couple more which insert characters A, or R (it's a way of me keeping track of how many items per hour I am processing in my work).

Everything was working fine, until yesterday, when all of a sudden, the Set Application Focus part of the phrase won't find the open notepad window. The .txt file is called "Tally Counter.txt"

Now when I use my phrases to insert text to the tally counter, I get a pop up from PE saying "Specified window not found".

I've noticed that after trying to use the phrases, the title of the .txt file in the open notepad window changes to "*Tally Counter.txt" I can't remember whether the "*" character always appeared when I used these phrases.

I'm using windows 10.
You do not have the required permissions to view the files attached to this post.

Peter Stotz
PhraseExpress Expert
Posts: 836
Joined: 27 Feb 08, 15:07

Post by Peter Stotz » 26 Mar 20, 16:22

@Andy S
Field: 'Window title (alternatively)" :
Test the entry
*Notepad
or
*Tally Counter - Notepad
instead of Tally Counter.txt - Notepad
(the * is a wildcard ...)

Peter
Windows 10 - PhraseExpress v14.0.183

Andy S
Posts: 14
Joined: 01 May 14, 16:12

Post by Andy S » 27 Mar 20, 07:57

Thanks Peter, "*Tally Counter - Notepad" works! But why have I needed to change this? and, will I always need to insert the * character before titles when using set application focus?

Peter Stotz
PhraseExpress Expert
Posts: 836
Joined: 27 Feb 08, 15:07

Post by Peter Stotz » 27 Mar 20, 09:53

@Andy S
The changed behaviour is probably due to a change by Microsoft (last Windows updates):
Unsaved Notepad files are now given a leading asterisk *
Therefore for your application "*Tally Counter - Notepad" is the best.

"will I always need to insert the * character before titles when using set application focus"
No.

Peter
Windows 10 - PhraseExpress v14.0.183

Andy S
Posts: 14
Joined: 01 May 14, 16:12

Post by Andy S » 27 Mar 20, 11:01

Ah, I see. Thank you for your help, sir!

Post Reply