display popup up menu by selecting a text

User-to-User discussion about the PhraseExpress macro programming.
Post Reply
Mamede
Posts: 28
Joined: 07 Apr 18, 13:47

display popup up menu by selecting a text

Post by Mamede » 30 May 20, 10:20

Hi ,
can we create a macro so that when we select a text (instead of typing it with the keyboard) ( the text correspondind to the Autotext ) and press a hotkey the corresponding popup up menu is displayed

example i have many phrases , named ,
phrases 1 : Covid in China ( Autotext = Covid )
phrases 2 : Covid in USA ( Autotext = Covid )
phrases 3 : Covid in France ( Autotext = Covid )

I am in a Web page reading about Covid 19 , instead of typing co ( of Autotext Covid ) to display the Popup menu , i select the word covid with the mouse ( with the right hand ) and press a hotkey with the left hand , and the corresponding popup up menu is displayed
It is less time consuming then type co ( of Autotext Covid ) , because we have to leave the mouse that is in the right hand , type co , and goback to the mouse

faithfully
Mamede

Peter S
PhraseExpress Expert
Posts: 923
Joined: 27 Feb 08, 15:07

Post by Peter S » 30 May 20, 21:24

@Mamede
Create a macro with the content
{#clipboard -copy}{#insert {#insertclipboard}}
and assign a hotkey to it.
The macro executes the highlighted autotext.
If the autotext refers to a phrase folder, the folder content is displayed as a menu.

Peter
Windows 10 - PhraseExpress v15.0.46-beta

Mamede
Posts: 28
Joined: 07 Apr 18, 13:47

Post by Mamede » 07 Jun 20, 15:54

Hi ,
thank you very much it works very well ,except that the phrase is inserted immediately even though I check in the expert option the manual confirmation checkbox
I would first like to display the description of the phrase and insert it manually with a left click of the mouse as if you begin to type the first two caracter of the autotext and only when 2 or more phares have the same autotext that the description of the phrases are displayed by {#clipboard -copy}{#insert {#insertclipboard}} macro
i tried to insert a space after the autotext word without result
any help
thank you

Peter S
PhraseExpress Expert
Posts: 923
Joined: 27 Feb 08, 15:07

Post by Peter S » 07 Jun 20, 20:20

I see.
As a workaround, you could combine two phrases:
1. Phrase with your hotkey for the left hand
{#setclipboard}{#clipboard -copy}{#msgbox -head Execute phrase »{#insertclipboard}« ? -text Interpret the selected string »{#insertclipboard}« as an autotext of a phrase and execute it? -yes ##execute -no -cancel -defaultyes}

2. Phrase with - for example - autotext ##execute and content:
{#insert {#trim {#insertclipboard}}}

If the selected string refers to an autotext for a phrase folder, the folder content is displayed as a menu.

Peter
Windows 10 - PhraseExpress v15.0.48-Beta

rkychu
PhraseExpress Expert
Posts: 6
Joined: 21 Feb 09, 06:57

Post by rkychu » 10 Jul 20, 03:31

Peter Stotz wrote:
30 May 20, 21:24
{#clipboard -copy}{#insert {#insertclipboard}}

The macro executes the highlighted autotext.
If the autotext refers to a phrase folder, the folder content is displayed as a menu.
Hello Peter, while "the macro executes the highlighted autotext", is there a way to make the macro executes the highlighted descriptions"? meaning, perhaps, initiating a search in the description???

Thanks.

Peter S
PhraseExpress Expert
Posts: 923
Joined: 27 Feb 08, 15:07

Post by Peter S » 10 Jul 20, 10:25

@rkychu
hmm - this is tricky...
I think, there is no direct access to the description of a phrase...

But there is a - rather unknown - macro command {#contents}
If {#contents} is inserted as phrase description, the phrase contents are displayed in selection menus !

What application idea is behind your question?
What do you want to achieve with such an application - maybe there is another way?

Peter
Windows 10 - PhraseExpress v15.0.57-Beta

rkychu
PhraseExpress Expert
Posts: 6
Joined: 21 Feb 09, 06:57

Post by rkychu » 14 Jul 20, 05:57

Thanks Peter for your reply.
I think, yes indeed, a much easier way of doing that is to assign a hot key to a folder whereupon the description is immediately searchable for the purpose of text insertion (to the point that "autotext" is not needed); that's simple enough to me and totally workable - I think I should stick with that.
I was hoping for being able to copy a chuck of text and automatically search for it in the description, but on second though there's not much of a need for that.
But thanks for your marco. It is helping me a great deal. Thanks.

Mamede
Posts: 28
Joined: 07 Apr 18, 13:47

Post by Mamede » 15 Aug 22, 13:55

Hi Peter ,
The {#clipboard -copy}{#insert {#insertclipboard}} macro , function perfectly
The macro executes the highlighted autotext and if the autotext refers to a phrase folder, the folder content is displayed as a menu , but the menu is not editable and i have to search for it in the programme windows to edit it
Has i had to put another macro inside to be editable

Paithfully

Mamede

Post Reply