Messages - verszipo [ switch to compact view ]

Pages: prev1 2 3 [4] 5 6next
16
How exactly did you solve it ?
Somebody else might have the same problem, so if you write your sollution it might be helpfull to others.

p.s. i've never tried paste or sendkeys so i don't know how they work.

17
General Software Discussion / Re: Opera 15 Preview
« on: July 02, 2013, 01:51 PM »
I'll stick with Opera 12 until either they re-add all the missing features into Opera 15 or the current one stops working, in which case i'll search for something else.

As somebody said, if we wanted Chrome we would have used chrome.

18
FARR Plugins and Aliases / Re: CZB pack
« on: June 05, 2013, 03:52 AM »
I had some trouble with the JSCalc plugin from the pack, it triggers everytime i enter a "+" character, even if it's at the start of the command, because of this i could not use folder modifiers (for example the "+music" from the FARR demo video).

I found a solution, I modified the JSCalc's code to ignore the command if it starts with the "+" char but to accept it if it's one of the later characters.
For that, I've changed
Code: Javascript [Select]
  1. var searched = queryraw.search(regexp);
  2. if(settings.special_trigger === "1" && searched !== -1){
with
Code: Javascript [Select]
  1. var searched = queryraw.search(regexp);
  2. var filteraliases = queryraw.match(new RegExp("^[^+]"));
  3. if(settings.special_trigger === "1" && searched !== -1 && filteraliases){
in the CZBPack\JScalc\fsubscript.js file.

I thought maybe some other people might be interested in this fix.

P.S. thanx CZB for the pack, i use the scripts a lot and i learned a lot from the script's code too.

19
FARR Plugins and Aliases / FarSubScript : GoogleSearch
« on: May 27, 2013, 08:22 AM »
I needed a way to do money/unit conversions in FARR and since I usually use Google Search for that i thought I'd make a script to call GoogleSearch inside FARR.

Here's the script
Spoiler
Code: Javascript [Select]
  1. plugins["GoogleSearch"] =
  2. {
  3.         version: "1.0",
  4.         lastChange: new Date(fso.GetFile(currentDirectory+"\\fsubscript.js").DateLastModified).toDateString(),
  5.         displayName: "GoogleSearch",
  6.         directory: currentDirectory,
  7.         icon: currentDirectory + "\\favicon.ico",
  8.         aliasstr: "gs",
  9.         description: "Search using Google (usefull for online conversions)"
  10. };
  11.  
  12. (function ()
  13. {
  14.         var js = plugins["GoogleSearch"];
  15.         var loaded = false;
  16.         var match = false;
  17.         var match2 = false;
  18.         var loadurl = "";
  19.         js.search = function search(querykey, explicit, queryraw, querynokeyword,modifierstring,triggermethod)
  20.         {
  21.                 if(!explicit) return;
  22.  
  23.                 idletime = 0;
  24.                 // first : match when a space is at the end of the string
  25.                 match = queryraw.match(new RegExp("^"+js.aliasstr+" (.+)  $"));
  26.                 // second : match when the user presses enter
  27.                 match2= queryraw.match(new RegExp("^"+js.aliasstr+" (.+)$"));
  28.  
  29.                 if((match && match[1])||
  30.                   (triggermethod && match2 && match2[1]))
  31.                 {
  32.                         loaded = true;
  33.                         // formated HTML must be like this :
  34.                         // http://www.google.ro/search?q=query string
  35.                         // Example : http://www.google.ro/search?q=10$ in euro
  36.                         if (match)
  37.                                 loadurl = "http://www.google.ro/search?q="+match[1];
  38.                         else if (match2)
  39.                                 loadurl = "http://www.google.ro/search?q="+match2[1];
  40.                         else
  41.                                 loadurl = "";
  42.                         htmlViewURL(loadurl);
  43.                         showPleaseWait("Loading..");
  44.                 }
  45.                 else
  46.                 {
  47.                         showHTML("<b>GoogleSearch</b>\
  48.                                 <br>Search using the power of the Google Search service\
  49.                                 <br><br>\
  50.                                 <br>Syntax : <b>"+js.aliasstr+" search string</b>\
  51.                                 <br>(either press ENTER or twice SPACE at the end of the search string)\
  52.                                 <br><br>You can use the special search options of google\
  53.                                 <br><br>Example: <b><br>"+js.aliasstr+" 10$ in euro</b>\
  54.                                 <br>this will show you how much 10$ are in euros\
  55.                                 <br><br>\
  56.                                 <br>For a complete set of supported values look at\
  57.                                 <br><a href=http://www.google.com/insidesearch/tipstricks/all.html>http://www.google.com/insidesearch/tipstricks/all.html</a>\
  58.                         ");
  59.                 }
  60.         };
  61.         js.setStrValue = function onSetStrValue(varname,value)
  62.         {
  63.                 if(varname == "EmbeddedWb.DocumentComplete")
  64.                 {
  65.                         var pl = pluginInCharge();
  66.                         if(pl == "GoogleSearch" && loaded)
  67.                         {
  68.                                 loaded = false;
  69.                                 // hide the "Chrome browser" advertisment
  70.                                 execSafeJS("\
  71. //                                      document.getElementById('gt-bbar').style.display='none';\n\
  72.                                 ");
  73.                                 hidePleaseWait();
  74.                         }
  75.                 }
  76.         }
  77. }());


Usage :
gs search string<space><space>
or
gs search string<enter>

Note : since i usually search for things that contains spaces i made the script to autosearch only when i enter 2 consecutive spaces (otherwise when entering "10$ in euro" it would autosearch after the 10$ and also after in)

There are still some bugs in it, the most notable ones are :
- cannot open the search results in the browser that you set in FARR (the alternate browser setting), the workaround is to copy the link's address and paste it in FARR and press enter (that will open the browser)

Note : this script requires FarSubScript, make sure you have it installed and working in FARR.

Install :
extract the content of the archive into a subfolder under the Scripts folder of FARR (for example : plugins\GoogleSearch) and either write "goreload" in FARR (this will reload all plugins) or restart FARR.

If anybody wants to improve the script feel free to do so.

20
FARR Plugins and Aliases / FarSubScript : Google Translate.
« on: May 27, 2013, 05:55 AM »
Since CZB's Google Translate script doesn't work anymore (because of the Google Api changes) I thought I'd make a script that loads the GoogleTranslate page in FARR with a given word.

So, here's my first attempt at it, I've used the NinjaWords script as a starting point :
Spoiler
Code: Javascript [Select]
  1. plugins["GoogleTranslate"] =
  2. {
  3.         version: "1.0",
  4.         lastChange: new Date(fso.GetFile(currentDirectory+"\\fsubscript.js").DateLastModified).toDateString(),
  5.         displayName: "GoogleTranslate",
  6.         directory: currentDirectory,
  7.         icon: currentDirectory + "\\favicon.ico",
  8.         aliasstr: "gt",
  9.         description: "Translate the word using Google Translate"
  10. };
  11.  
  12. (function ()
  13. {
  14.         var js = plugins["GoogleTranslate"];
  15.         var loaded = false;
  16.         var match = false;
  17.         var match2 = false;
  18.         var loadurl = "";
  19.         js.search = function search(querykey, explicit, queryraw, querynokeyword,modifierstring,triggermethod)
  20.         {
  21.                 if(!explicit) return;
  22.  
  23.                 idletime = 0;
  24.                 // first : match when a space is at the end of the string
  25.                 match = queryraw.match(new RegExp("^"+js.aliasstr+" ([a-z,A-Z,0-9]+) ([a-z,A-Z,0-9]+) (.+) $"));
  26.                 // second : match when the user presses enter
  27.                 match2= queryraw.match(new RegExp("^"+js.aliasstr+" ([a-z,A-Z,0-9]+) ([a-z,A-Z,0-9]+) (.+)$"));
  28.  
  29.                 if((match && match[1] && match[2] && match[3])||
  30.                   (triggermethod && match2 && match2[1] && match2[2] && match2[3]))
  31.                 {
  32.                         loaded = true;
  33.                         // formated HTML must be like this :
  34.                         // http://translate.google.com/#<srclng>/<destlng>/<word>
  35.                         // you can use "auto" as srclng for autodetection
  36.                         // Example : http://translate.google.com/#auto/en/word
  37.                         if (match)
  38.                                 loadurl = "http://translate.google.com/#"+match[1]+"/"+match[2]+"/"+match[3];
  39.                         else if (match2)
  40.                                 loadurl = "http://translate.google.com/#"+match2[1]+"/"+match2[2]+"/"+match2[3];
  41.                         else
  42.                                 loadurl = "";
  43.                         htmlViewURL(loadurl);
  44.                         showPleaseWait("Loading..");
  45.                 }
  46.                 else
  47.                 {
  48.                         showHTML("<b>GoogleTranslate</b>\
  49.                                 <br>Translate a given text using the Google Translate service\
  50.                                 <br><br>\
  51.                                 <br>Syntax : <b>"+js.aliasstr+" srclng destlng word</b>\
  52.                                 <br><b>srclng</b> is the source language\
  53.                                 <br><b>destlng</b> is the destination language\
  54.                                 <br><b>word</b> is the word we want to translate\
  55.                                 <br><br>Example: <b><br>"+js.aliasstr+" en de computer</b>\
  56.                                 <br> this will translate the 'computer' word from english to german\
  57.                                 <br><br>Note : for source language you can type <b>'auto'</b> and Google will try to detect the language\
  58.                         ");
  59.                 }
  60.         };
  61.         js.setStrValue = function onSetStrValue(varname,value)
  62.         {
  63.                 if(varname == "EmbeddedWb.DocumentComplete")
  64.                 {
  65.                         var pl = pluginInCharge();
  66.                         if(pl == "GoogleTranslate" && loaded)
  67.                         {
  68.                                 loaded = false;
  69.                                 // hide the "Chrome browser" advertisment
  70.                                 // hide the "Search | Images |..." toolbar
  71.                                 execSafeJS(
  72.                                         "document.getElementById('gt-bbar').style.display='none';\n\
  73.                                         document.getElementById('gb').style.display='none';\
  74.                                 ");
  75.                                 hidePleaseWait();
  76.                         }
  77.                 }
  78.         }
  79. }());


Usage :
gt source_language destination_language word <space>
or
gt source_language destination_language word <enter>

source_language can be "auto" and then Google Translate will try to detect what language it is from.

There are still some bugs in it, the most notable ones are :
- you need to press space after the word (pressing Enter doesn't do the translation)
- doesn't support multiple word translation
- sometimes the page loads without the word(s), if you delete the space and add it again then it loads correctly
- after pressing Enter at the end of the search string FARR looses focus and the editbox from GoogleTranslate page gets the focus

Note : this script requires FarSubScript, make sure you have it installed and working in FARR.

Install :
extract the content of the archive into a subfolder under the Scripts folder of FARR (for example : plugins\GoogleTranslate) and either write "goreload" in FARR (this will reload all plugins) or restart FARR.

If anybody wants to improve the script feel free to do so.

Update : now supports multiple texts in one line and you can either press space or enter after the word(s) that you want to translate.

Pages: prev1 2 3 [4] 5 6next
Go to full version