topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 3:03 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: How to modify/extend the trigger keyword of a plugin?  (Read 5129 times)

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
How to modify/extend the trigger keyword of a plugin?
« on: June 13, 2008, 05:34 PM »
Can you help me out?
I'd like to 'modify' some plugins so that their behaviour suits me better.

As an example, I'd like to override the 'plist' (show printers) plugin,
so that when I enter 'plist' I actually get 'plist +sall'.

What's the best way? 


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #1 on: June 13, 2008, 05:53 PM »
This is a good question because i suspect people often want to change the way plugins are triggered.

you would need to do 2 things:
1) go to options,plugins, plugin manager, select the plist plugin and then override the trigger for printer list to something else, maybe like p2list.
2) then go to aliases, select myaliases file which you can edit:
and add a new alias named plist,
set regex to ^plist(.*)$
and in the results put
dosearch p2list$$1 +sall

i think that will do it.  it's off the top of my head so if it fails let me know.

there are other ways too -- nitrix is really good at coming up with stuff so maybe he will post a reply too.

but the basic idea of my method is to rename the original and then use a dosearch action to make one thing typed act like another.

Having said that:
We should ask taichi to make the printerlist plugin always display all results.  he can do that but probably just doesnt know how or it didn't occur to him.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #2 on: June 13, 2008, 05:58 PM »
Plugin writers, to force FARR into showing all results for your plugin call:
set_strval("setshowallmode","");

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #3 on: June 13, 2008, 07:09 PM »
Thank you.

I have the principle.

Your example of "p2list" is a bit dodgy as the "2" immediately selects the second entry that matches "p".
That was a test, right?  ;)


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #4 on: June 13, 2008, 08:02 PM »
i should clarify:
you aren't meant to ever type p2list after this change.
you could have changed it to "jhgkljdhglkdjhg"

the only goal is to rename the real trigger to something you wont type
and then you type plist and only the alias will use the new keyword (p2list or jhgkljdhglkdjhg)

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #5 on: June 13, 2008, 08:21 PM »
you aren't meant to ever type p2list after this change.
-mouser

Unless one wants to use the plugin also in its original form.
(I was using plist as an example of what I wanted)


you could have changed it to "jhgkljdhglkdjhg"
-mouser

Now you tell me!  I tried everything; "jhgkljdhglkdjg", "jhkljdhglkdjhg", "jhgkljhglkdjhg"...  :o

I might have a grasp on it this time, or not.


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: How to modify/extend the trigger keyword of a plugin?
« Reply #6 on: June 13, 2008, 08:33 PM »
:)

yes good point, if you want to also be able to use the original then you need to rename it to something more useful.