Welcome Guest.   Make a donation to an author on the site April 24, 2014, 06:15:47 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Free DonationCoder.com Member Kit: Submit Request.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: AHK: multiple hotstrings  (Read 2188 times)
Armando
Charter Member
***
Posts: 2,666



see users location on a map View Profile Give some DonationCredits to this forum member
« on: January 06, 2008, 07:21:35 PM »

I guess I could post that simple question in a specialized forum, but I know many here are AHK experts so...


I make an extensive use of AHK "auto-replace hotstring" (to expand abbreviations as I type them).

Now, I'd like to know how to have multiple potential hotstrings for the same string replacement.

Example. Let's say I have this line :

[copy or print]
:oc:parc2::tgsPÉtRe tgsPunié tgsPdoct tgsPThDo tgsPARC2 tgsPat tgsPthée


but I want to have more than one hotstring ("parc2" in that case) to trigger the string replacement "tgsPÉtRe tgsPunié tgsPdoct tgsPThDo tgsPARC2 tgsPat tgsPthée". (For example : I'd like to have "parc3" and "parc4" to trigger the same string replacement.)

What would be the proper syntax?

Thanks a lot!
« Last Edit: January 07, 2008, 03:49:16 AM by brotherS » Logged

"I suppose it can be said that I'm an absent-minded driver. It's true that I've driven through a number of red lights on occasion, but on the other hand, I've stopped at a lot of green ones but never gotten credit for it."
Glenn Gould
lanux128
Global Moderator
*****
Posts: 6,048



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: January 06, 2008, 07:29:36 PM »

why not just repeat them twice, like this..

[copy or print]
::parc3::tgsPÉtRe tgsPunié tgsPdoct tgsPThDo tgsPARC2 tgsPat tgsPthée
::parc4::tgsPÉtRe tgsPunié tgsPdoct tgsPThDo tgsPARC2 tgsPat tgsPthée
Logged

jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: January 06, 2008, 07:32:19 PM »

The following solution would solve it:

[copy or print]
:oc:parc1::
:oc:parc3::
:oc:parc2::
  send, tgsPÉtRe tgsPunié tgsPdoct tgsPThDo tgsPARC2 tgsPat tgsPthée
  return

(this way, all of them execute whatever comes after the :oc:parc2:: line, until they find a return)

[edit] damn, lanux beat me![/edit]
Logged

Armando
Charter Member
***
Posts: 2,666



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #3 on: January 06, 2008, 07:56:23 PM »

Ah! Thanks guys.

Lanux : That's what I was doing already, but I didn't want to paste the string repeatedly : it's not convenient when you make changes to the string.

jgpaiva : Exactly what I was trying to do.  smiley The "send" command. Ok.
Logged

"I suppose it can be said that I'm an absent-minded driver. It's true that I've driven through a number of red lights on occasion, but on the other hand, I've stopped at a lot of green ones but never gotten credit for it."
Glenn Gould
lanux128
Global Moderator
*****
Posts: 6,048



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: January 06, 2008, 08:22:49 PM »

hehe.. at least jgpaiva understood the question better than me.. smiley
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.034s | Server load: 0.09 ]