DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Calling all plugin coders who usedFscript/Fsubscript -- please upgrade to latest  (Read 31,327 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
There is a conflict between plugins that use different versions of the fscript.dll and fsubscript dll, and we really need to get them all updated.
Part of the problem was probably my fault, but the result is that plugins with older versions of fscript/fsubscript can crash with some non-fscript plugins (klipkeeper),
but upgrading the fscript.dll causes these plugins to misbehave, like showing the settings screens over and over.

For an example see this thread: http://www.donationcoder.com/forum/index.php?topic=18622.0

SO I think the solution goes like this:
If you authored a plugin using fscript, please go get the latest fscript from this page:
http://e.craft.free.fr/farr/FScript/

And then test your plugin and make sure it all works fine, and then upload a new version with the new fscript and let us know it's updated.

In the coming weeks i'm going to be making screencast videos of all the plugins in action so i need them to be working for others who want to try them.

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
And what do I do if it doesn't work?  :(

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
what doesn't work?

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
what doesn't work?
Hard to say, but Perry's on first!
Chris

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
For all you youngsters who don't get the joke:

http://www.youtube.com/watch?v=sShMA85pv8M


Screenshot - 9_15_2009 , 12_50_39 PM_thumb.png


Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
what doesn't work?

Does that mean I Don't Know is coming next?

I did try to convert my TimeZone plugin to use 1.18 or 1.19 but had lots of issues. From memory onProcessTrigger was being called in TimeZone for each Trigger in FARR (regardless if the Search trigger was a result of a TimeZone search).

I was PM'ing ecaradec, but it never got resolved  :( So I gave up and kept using the one that worked.

Recent thought: could other plugins on my system be mucking it up??

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
i *think*, if i remember correctly, that what you are experiencing is that farr/fsscript call onprocesstrigger differently, and a minor change is needed to your code now to test if indeed it should trigger or not.  i believe this is the source of the incompatibilities which is why we need to get everyone updated.  let me talk to ecaradec and czb and see if i cant post instructions on how the change should be implemented.  it's something minor and its my fault.

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
i *think*, if i remember correctly, that what you are experiencing is that farr/fsscript call onprocesstrigger differently, and a minor change is needed to your code now to test if indeed it should trigger or not.  i believe this is the source of the incompatibilities which is why we need to get everyone updated.  let me talk to ecaradec and czb and see if i cant post instructions on how the change should be implemented.  it's something minor and its my fault.

Thanks: appreciate it. That was what I thought but I could not get a confirmation on the code to use.

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
i *think*, if i remember correctly, that what you are experiencing is that farr/fsscript call onprocesstrigger differently, and a minor change is needed to your code now to test if indeed it should trigger or not.  i believe this is the source of the incompatibilities which is why we need to get everyone updated.  let me talk to ecaradec and czb and see if i cant post instructions on how the change should be implemented.  it's something minor and its my fault.

OK: I think I've found it... the short answer is to add the following code to onProcessTrigger:
Code: (javascript)
		if(pluginid!=thispluginid){
			return 0;
		}

The longer answer follows...  ;)

I downloaded the latest FScriptSample (http://e.craft.free.fr/farr/FScript/samples/FScriptSample.rar) and placed it into FARR's Plugin directory, and then replaced the dll with the latest version 1.19 (http://e.craft.free.fr/farr/FScript/1.19/fscript.dll).

I'm not actually sure where I got it from now (can't seem to find it anywhere  :-\ :-[), but the onProcessTrigger I ended up with was:
Code: (javascript)
function onProcessTrigger(path, caption, groupname, pluginid, thispluginid,score, entrytype, args, triggermode) {
		if(triggermode!=TM_EXPLICIT){
			return 0;
		}
    counter++;
    FARR.setStrValue("setsearch", "fscript");
    return HANDLED;
}

The above code didn't work at all (counter never changed) so I added the following (format changes for readability):
Code: (javascript)
FARR.debug("Path: " + path + 
                    "; Caption: " + caption + 
                    "; GroupName: " + groupname + 
                    "; PluginID: " + pluginid + 
                    "; ThisPlugin: " + thispluginid + 
                    "; Score: " + score + 
                    "; EntryType: " + entrytype + 
                    "; Args: " + args + 
                    "; TriggerMode: " + triggermode)

When launching a spreadsheet this was displayed:
Screenshot - 17_09_2009 , 9_26_14 PM.png
When launching FScriptSample this was displayed:
Screenshot - 17_09_2009 , 9_27_40 PM.png

From that I assumed that PluginID should equal ThisPluginID and changed the code to:
Code: (javascript)
function onProcessTrigger(path, caption, groupname, pluginid, thispluginid,score, entrytype, args, triggermode) {
		if(pluginid!=thispluginid){
			return 0;
		}
		FARR.debug("Path: " + path + "; Caption: " + caption + "; GroupName: " + groupname + "; PluginID: " + pluginid + "; ThisPlugin: " + thispluginid + "; Score: " + score + "; EntryType: " + entrytype + "Args: " + args + "; TriggerMode: " + triggermode)
    counter++;
    FARR.setStrValue("setsearch", "fscript");
    return HANDLED;
}

With that the Plugin correctly returned 0 when called when launching the spreadsheet, and incremented counter correctly and displayed the following:
Screenshot - 17_09_2009 , 9_31_15 PM.png

Concerning the mystery of where I got the version of onProcessTrigger...
The version that is distributed with the (latest) sample is:
Code: (javascript)
HANDLED=1; CLOSE=2;
function onProcessTrigger(path, caption) {
    counter++;
    FARR.setStrValue("setsearch", "fscript");
    return HANDLED;
}

This version works for FScriptSample, but other triggers don't work: (eg can't run the spreadsheet, just get Hello).

I've searched everywhere for the version that I used, but can't find it anywhere, but I must have got it somewhere... But some of the parameters don't seem to get filled: which is confusing.

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
And then test your plugin and make sure it all works fine, and then upload a new version with the new fscript and let us know it's updated.

TimeZone is done  :Thmbsup: (this turned out better than I hoped!!)

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • Cody Award
    • Official Forum Clown
    • rotten turkey sandwich - Rotten Turkey Sandwich
TimeZone[/url] is done
Well done, Perry  :up:  :up:
Chris

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,931
    • Gathering Badge
    • Plugin Coding Medal
    • Participated in NANY Challenge Seventeen Times
    • Cody Award
    • Coding Snacks
    • Volunteers/Staff
thank you so much for solving this mystery Perry, you basically hit the nail on the head.

the onProcessTrigger function is called whenever any result is launched -- whether created by your plugin or by another or by no plugin at all.

so to make your plugin only try to handle it's own -- you check thispluginid vs pluginid and ignore it if they don't match -- UNLESS you are writing a plugin that is trying to take over all launching.

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • Participated in NANY Challenge Three Times
    • Plugin Coding Medal
so to make your plugin only try to handle it's own -- you check thispluginid vs pluginid and ignore it if they don't match -- UNLESS you are writing a plugin that is trying to take over all launching.

All good in that regard: just had to correct the example.

But I've discovered that FScript has also lost its ability to Trigger vbScripts  :(  :(   :(

Original address: https://www.donationcoder.com/forum/index.php?topic=19869.0