topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Sunday December 15, 2024, 7:13 pm
  • 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

Last post Author Topic: FScript Javascript SDK - Write FARR plugins in javascript and more.  (Read 113419 times)

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
FScript 1.7 is uploaded.
onProcessTrigger can now return a set of flags to tell if the result was processed and if farr window should close.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • View Profile
    • Donate to Member
FScript 1.7 is uploaded.
onProcessTrigger can now return a set of flags to tell if the result was processed and if farr window should close.

Wondefrul Ecaradec: Thanks! I'm eager to play with this...  :Thmbsup:

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • View Profile
    • Donate to Member
OR if you are doing a takeover of the OnProcessTrigger, ecaradec just added the ability to tell farr not to close -- you return a value of 1 from that event function. BUT BUT BUT -- i don't think ecaradec has made that new version of fscript public yet (1.6) so you need that first.

What I'm wondering about doing is showing the HTML window with a page generated by the plugin: is that process documented somewhere?

Would it be something as easy as:
Code: Javascript [Select]
  1. var htmlString = "<html><body>Hello World</body></html>:;
  2. FARR.setStrValue("window.htmlmode",htmlString);
« Last Edit: June 23, 2008, 05:49 PM by Perry Mowbray »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
you would call it like this
FARR.setStrValue("launch","showhtml "+htmlString);

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • View Profile
    • Donate to Member
you would call it like this
FARR.setStrValue("launch","showhtml "+htmlString);

 :Thmbsup:

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
FScript 1.8 is out.
I added some functions to allow the use of autohotkey to build options user interfaces dialog. I find it really nice to build UI.
The principle is to launch the settings executable, let the user change parameters and call PostMessage,0x400,0,0,,FScript/{pluginname} from the ahk script to tell FScript to reload plugins.

1)
function onDoAdvConfig() {
    FARR.exec("settings.ahk", "", currentDirectory)
    return true;
}

2) user change params and press ok
3) save user params into an ini file
4) call PostMessage,0x400,0,0,,FScript/{pluginname} from ahk script to warn your plugin that the options changed. Fscript will call onOptionsChanged to allow you to reload your options. Use FARR.getIniValue to read the user settings.


Blog & Projects : Blog | Qatapult | SwiffOut | FScript

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
Amazing work as usual. Cant wait to try this out.

Thx :Thmbsup:

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
I just wanted to add that the ahk dialog is demonstrated in the delicious plugin, in case you miss it. :)
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
I just wanted to add that the ahk dialog is demonstrated in the delicious plugin, in case you miss it.

i noticed it since ahk dialog opens up every time i use the delicious plugin (dpu) ... which is very annoying... is it intended, if yes is it possible to remove it ?

btw, delicious plugin is great !


ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
This is a bug. However unrelated with the new ahk support.

I will upload a fix but you can fix it now by changing  :
Code: Javascript [Select]
  1. // no valid password ? ask the user when he start a request
  2.     if(username=="" || password=="")
  3.         showOptions();

with
Code: Javascript [Select]
  1. // no valid password try to load it
  2.     if(username=="" || password=="")
  3.         onOptionsChanged();
  4.  
  5.     // or ask the user
  6.     if(username=="" || password=="")
  7.         showOptions();

in the plugins/delicious/fscript.js file
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
I will upload a fix but you can fix it now by changing

great ;)

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
ecaradec is there any chance you could add the ability use an html file as the readme file. I tried using readme.html but its not being launched however readme.txt works fine.

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Yes I will add it.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
Thx  :Thmbsup:

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Re: FScript Javascript SDK - Write FARR plugins in javascript and more.
« Reply #39 on: October 16, 2008, 05:54 AM »
I don't have any time to to work on fscript currently. I added a link to download the source code in the original message. I'll have time to answer questions, however. Feel free to contact me :)
Blog & Projects : Blog | Qatapult | SwiffOut | FScript
« Last Edit: October 16, 2008, 11:39 AM by ecaradec »

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: FScript Javascript SDK - Write FARR plugins in javascript and more.
« Reply #40 on: October 16, 2008, 04:31 PM »
ecaradec is there any chance you could add the ability use an html file as the readme file. I tried using readme.html but its not being launched however readme.txt works fine.
I think this one is simple enough. I could fix it if you like. Or ecaradec, if you have time to at least build the DLL I could send you the changed code, it's only 3 lines. I won't integrate it into your git repository though (if I could, that is). Had a look at git and didn't like it :(. TortoiseSVN is soooo comfortable :)  (and it looked like work on the 'TortoiseGIT' has been abandoned).

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: FScript Javascript SDK - Write FARR plugins in javascript and more.
« Reply #41 on: October 19, 2008, 07:43 AM »
ecaradec is there any chance you could add the ability use an html file as the readme file. I tried using readme.html but its not being launched however readme.txt works fine.
I've uploaded a version that fixes this bug to here (and named it 1.8.1). This version correctly launches the file specified with the readmestring variable when the user clicks the 'View Plugin Readme' button on the FARR Plugin Manager window.

To s.newave: please note that in your GooglePlus plugin you've specified GooglePlus.html as the readme file while the file actually installed with the plugin is called readme.html.

To ecaradec: the offer still stands. If you want I can send you the changed file to integrate it into your source repository.

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
Re: FScript Javascript SDK - Write FARR plugins in javascript and more.
« Reply #42 on: October 20, 2008, 01:11 PM »
phitsc: thanks for the update :Thmbsup: Great timing too as im just finishing up a small update to GoogePlus.

On a related note does anyone know if its possible to use onReceiveKey() in normal mode? Per ecaredec's readme it works great in memo mode but i cant get it to work in normal result mode?

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: FScript Javascript SDK - Write FARR plugins in javascript and more.
« Reply #43 on: October 20, 2008, 02:48 PM »
On a related note does anyone know if its possible to use onReceiveKey() in normal mode? Per ecaredec's readme it works great in memo mode but i cant get it to work in normal result mode?
I think it's not an FScript problem. If I remember correctly I tried to use it as well (in list mode, with the native plugin interface) and it didn't work. I think it's meant to be used in memo mode only (likewise onIdleTime and the new triggermethod parameter in onSearchBegins). But don't take my word for it. (not sure if that's the correct expression now ;) )

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
Re: FScript Javascript SDK - Write FARR plugins in javascript and more.
« Reply #44 on: October 20, 2008, 05:19 PM »
I think it's not an FScript problem. If I remember correctly I tried to use it as well (in list mode, with the native plugin interface) and it didn't work. I think it's meant to be used in memo mode only (likewise onIdleTime and the new triggermethod parameter in onSearchBegins). But don't take my word for it. (not sure if that's the correct expression now ;) )

That's what i was afraid of. Hopefully when Mouser has some time he can look into expanding the hotkey functionality similar to what i mentioned in this post:

...

I would also imagine that you would need to add an option to specify the scope of the hotkey i.e. global or local. Local hotkeys would only work within FARR whereas global ones would work from anywhere. This could also be expanded to work with plugins similar to how a plugin alias file works. Plugins could then specify hotkeys in a hotkey file that only works within their plugins and have certain plugin specific functions. Keywords/variables could be created for certain actions that could be shared like aliases.

Would be great to give plugins some control over hotkeys that could be managed from the same ui as other hotkeys. This way users could change hotkeys to sort their needs.
« Last Edit: October 20, 2008, 07:03 PM by s.newave »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FScript Javascript SDK - Write FARR plugins in javascript and more.
« Reply #45 on: October 21, 2008, 03:37 AM »
Im making my way methodically through all of my programs now updating them with the most important new feature requests.  Anything that plugin writers need will get top priority, so i'm happy to add this in the next couple of weeks.

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,198
    • View Profile
    • Donate to Member
Re: FScript Javascript SDK - Write FARR plugins in javascript and more.
« Reply #46 on: October 21, 2008, 05:39 AM »
... so i'm happy to add this in the next couple of weeks.
As a native speaker of German I always have to remind myself that when you native English speaking guys say 'a couple' you usually mean two, while we German speakers more often use that expression as 'a few'. At least this is how my English colleagues use it ;)

Related to that I'd like to put the plugin related feature requests I sent you a couple of, no I mean a few weeks ago up for public discussion. I'll do that in a separate topic however.

ChrisVN

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Can you help me getting started with a Pyhton script?
« Reply #47 on: March 01, 2009, 07:26 AM »
Hello

First of all:
Thanks for FARR and FScript. I like controlling the PC with the keyboard - so this is a perfect tool  :)

As a former programmer I like the idea of extending the functionality with Python scripts.
I have been searching for a while for a reason to start learning Pyhton  ;)

So: I am new to FARR and Python and got stuck in the beginning.

What I tried to do: I converted the sample ruby-script to the Pyhton syntax.
BUT: the plugin doesn't show up at all in the list of plugins
OR: the proberties of the plugin only contain strange characters like ??????? (see attachted screenshot)

My Setup:
 - Windows Vista
 - ActiveState Python v3
 - FARR
 - FScript dll v1.8.0.0

I created a directory with those files:
c:\Program Files\FARR\Plugins\TESTPython\FScript.dll
c:\Program Files\FARR\Plugins\TESTPython\FScript.ico
c:\Program Files\FARR\Plugins\TESTPython\fscript.py

At this point I have no idea what the problem is  :tellme:
Any ideas to help me?

Thanks
Chris

p.s.:
this is the pyhton script:

Code: Python [Select]
  1. displayname="TESTPython"
  2. versionstring="0.0.1"
  3. author="Author"
  4. iconfilename="FScript.ico"
  5. aliasstr="ttt"
  6. regexstr=""
  7. regexfilterstr=""
  8. keywordstr=""
  9. scorestr="300"
  10.  
  11. # type
  12. UNKNOWN=0; FILE=1; FOLDER=2; ALIAS=3; URL=4; PLUGIN=5; CLIP=5;
  13. # Postprocessing
  14. IMMEDIATE_DISPLAY=0; ADDSCORE=1; MATCH_AGAINST_SEARCH=2;
  15. # search state constants
  16. STOPPED=0; SEARCHING=1;
  17.  
  18. def onSearchBegin(querykey, explicit, queryraw, querynokeyword):
  19.   FARR.setState(querykey,SEARCHING) #start search
  20.   #   return result to farr  (queryID,       , title                            ,path                            , icon                         , entrytype=FILE , resultpostprocessing=2        ,  score=300)
  21.   FARR.emitResult(querykey,"python TITLE", "python PATH", iconfilename, ALIAS    ,IMMEDIATE_DISPLAY ,5000)
  22.   FARR.setState(querykey,STOPPED) #stopped search

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
You may be the first person actually using any other script language for Fscript besides javascript, and i'd LOVE to see this working.. so i hope ecaradec (FScript author) will check out this thread and help diagnose.  Please don't give up!

ecaradec

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 410
    • View Profile
    • Blog & Projects
    • Read more about this member.
    • Donate to Member
Everything seem fine in your sample. I must say that I didn't even try to write a python plugin, since I know little about python. I'll have a look soon.
Blog & Projects : Blog | Qatapult | SwiffOut | FScript