topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Friday June 27, 2025, 2:41 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

Recent Posts

Pages: prev1 ... 51 52 53 54 55 [56] 57 58 59 60 61 ... 113next
1376
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 08, 2012, 06:40 AM »
heres an attempt at an Alfred like skin (note i have never used it so its based on the screen shots I've seen)

I've been using it for a bit and noticed that to "get out of Qatapult" the number of times to type the escape key seems to be higher :)

Time to retrain the fingers and brain to use the hotkey may be...wonder how successful I'll be at that...
1377
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 08, 2012, 02:36 AM »
I tried a rough rewrite (non-idiomatic CoffeeScript) of OpenWith.collecter.js.  Removing the debugging related stuff, it looks like:

Code: Text [Select]
  1. collect = (query, results) ->
  2.   # for OpenTextFile
  3.   ForReading = 1
  4.   ForWriting = 2
  5.   ForAppending = 8
  6.   # http://coffeescriptcookbook.com/chapters/classes_and_objects/type-function
  7.   type = (obj) ->
  8.     if obj == undefined or obj == null
  9.       return String obj
  10.     classToType = new Object
  11.     for name in "Boolean Number String Function Array Date RegExp".split(" ")
  12.       classToType["[object " + name + "]"] = name.toLowerCase()
  13.     myClass = Object.prototype.toString.call obj
  14.     if myClass of classToType
  15.       return classToType[myClass]
  16.     return "object"
  17.   # file extension from file path
  18.   pathToExtension = (filePath) ->
  19.     extRE = /\.([^\\.]*)$/
  20.     ma = extRE.exec(filePath)
  21.     if not ma
  22.       return null
  23.     ma[1]
  24.   #
  25.   if not results.expects('FILE')
  26.     return
  27.   #
  28.   pane = qatapult.getFocus()
  29.   if pane != 2
  30.     return
  31.   #
  32.   fso = new ActiveXObject("Scripting.FileSystemObject")
  33.   #
  34.   p0 = qatapult.getArgValue(0, "path")
  35.   ext = pathToExtension(p0)
  36.   if not ext
  37.     ext = 'NONE'
  38.   #
  39.   table = {}
  40.   try
  41.     rf = fso.OpenTextFile("plugins\\OpenWith\\associations.js")
  42.     text = rf.ReadAll()
  43.     result = eval(text)
  44.   catch e
  45.     #
  46.   finally
  47.     rf.close()
  48.   #
  49.   if fso.FolderExists(p0)
  50.     if "_folderhandler" of table
  51.       ext = "_folderhandler"
  52.   if ext of table
  53.     rule = table[ext]
  54.     theType = type(rule)
  55.     switch theType
  56.       when "string"
  57.         path = rule
  58.         obj =
  59.           key: path
  60.           text: path
  61.           path: path
  62.         results.addObject('FILE', path, obj)
  63.       when "array"
  64.         for path in rule
  65.           obj =
  66.             key: path
  67.             text: path
  68.             path: path
  69.           results.addObject('FILE', path, obj)
1378
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 07, 2012, 09:03 PM »
Just a quick note to mention that slightly modifying the output of coffee (a CoffeeScript compiler), seems to produce a Qatapult-usable result.

The following CoffeeScript content for snippets.collecter.js:

Code: Text [Select]
  1. collect = (query, results) ->
  2.   if results.expects('TEXT')
  3.     fso = new ActiveXObject("Scripting.FileSystemObject")
  4.     f = fso.OpenTextFile("plugins\\snippets\\text.txt")
  5.     while not f.AtEndOfStream
  6.       l = f.ReadLine()
  7.       if qatapult.match(l, query)
  8.         obj =
  9.           key: l
  10.           text: l
  11.           icon: "plugins\\snippets\\text.jpg"
  12.         results.addObject('TEXT', l, obj)

turns into:

Code: Javascript [Select]
  1. (function() {
  2.   var collect;
  3.  
  4.   collect = function(query, results) {
  5.     var f, fso, l, obj, _results;
  6.     if (results.expects('TEXT')) {
  7.       fso = new ActiveXObject("Scripting.FileSystemObject");
  8.       f = fso.OpenTextFile("plugins\\snippets\\text.txt");
  9.       _results = [];
  10.       while (!f.AtEndOfStream) {
  11.         l = f.ReadLine();
  12.         if (qatapult.match(l, query)) {
  13.           obj = {
  14.             key: l,
  15.             text: l,
  16.             icon: "plugins\\snippets\\text.jpg"
  17.           };
  18.           _results.push(results.addObject('TEXT', l, obj));
  19.         } else {
  20.           _results.push(void 0);
  21.         }
  22.       }
  23.       return _results;
  24.     }
  25.   };
  26.  
  27. }).call(this);

I think removing the first and last lines may make the result usable by Qatapult.
1379
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 07, 2012, 08:55 PM »
BTW, any chance of being able to use PgUp and PgDn for results navigation?
1380
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 07, 2012, 07:56 PM »
This skin is my first time ever using js so please point out anything that's wrong.

You may find strong opinions about JavaScript :)

As I understand it, JavaScript didn't get much time for design and polish before it got shipped and this shows.  There are many oddities / warts in the language and sadly often trying to do things in a way that seems to make sense can backfire -- particularly if one has expectations about the language coming from a C / C++ (or similar) background.

If you intend to continue with the language, I highly recommend checking out some of Douglas Crockford's material early on, perhaps starting with:

  Crockford on JavaScript

Even if one doesn't agree with some or much of what he says, I've found his material well worth the time.

He suggests an approach to the language based on being quite selective in what to use in the language and staying away from certain bits (e.g. he suggests not using == or != and instead using === and !==).  I have found this helps tremendously for JavaScript (and even AHK) but it isn't necessarily the easiest thing to figure out or get used to.

To help in this process, there is a tool Crockford developed and maintains called jslint (and now at least one fork called jshint).  I used jslint while doing JavaScript (via FScript) plugin development for FARR and found it to be really helpful.  Haven't set it up for Qatapult yet, but based on working with the OpenWith plugin, getting the feeling it may be a good idea.



After writing the above, I remembered that there is now this thing called CoffeeScript.  It compiles to JavaScript and although it has its problems, seems a far nicer language to be writing in.  It's pretty easy to get it set up once one has Node.js installed.  May be I'll see how practical it would be to use for Qatapult-related things.

Any interest?
1381
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 05, 2012, 07:21 AM »
Perhaps one of the purposes was to attract attention...it seems there was some success in that...
1382
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 05, 2012, 03:34 AM »
Thanks for the pointer -- I'm not noticing anything with the colors under Windows XP Pro SP3.



Below is a bit fancier associations.js.  It provides an array addtoall which can be used to add applications to all configured extensions -- for example, it might be convenient for all extensions to be associated with applications such as hex editors, checksum calculators, etc.

Code: Javascript [Select]
  1. table =
  2.   (function () {
  3.     var table, ext, rule, theType,
  4.         //
  5.         ahk_h, ahk_l, emacs, frhed, gimp, hashmyfiles, hfs, nppp, pdfx,
  6.         sevenzip, smplayer, ssc, sumatra, uniextract, vlc, xnview,
  7.         //
  8.         imageviewers, videoplayers,
  9.         //
  10.         addtoall;
  11.     //
  12.     ahk_h = "..\\AutoHotkey_H\\Win32w\\AutoHotkey.exe";
  13.     ahk_l = "..\\AutoHotkey_L\\AutoHotkey.exe";
  14.     emacs = "..\\emacs\\bin\\runemacs.exe";
  15.     frhed = "..\\FrhedPortable\\FrhedPortable.exe";
  16.     gimp = "..\\GIMPPortable\\GIMPPortable.exe";
  17.     hashmyfiles = "..\\NirLauncher\\NirSoft\\hashmyfiles.exe";
  18.     hfs = "..\\hfs\\hfs.exe";
  19.     nppp = "..\\Notepad++Portable\\Notepad++Portable.exe";
  20.     pdfx = "..\\PDFX_Vwr\\PDFXCview.exe";
  21.     sevenzip = "..\\7-ZipPortable\\7-ZipPortable.exe";
  22.     ssc = "..\\ScreenshotCaptor\\ScreenshotCaptor.exe";
  23.     smplayer = "..\\SMPlayer\\smplayer.exe";
  24.     sumatra = "..\\SumatraPDFPortable\\SumatraPDFPortable.exe";
  25.     uniextract = "..\\uniextract\\UniExtract.exe";
  26.     vlc = "..\\VLCPortable\\VLCPortable.exe";
  27.     xnview = "..\\XnViewPortable\\XnViewPortable.exe";
  28.     //
  29.     imageviewers = [gimp, xnview];
  30.     videoplayers = [smplayer, vlc];
  31.     //
  32.     addtoall = [frhed, hashmyfiles, hfs];
  33.     //
  34.     table =
  35.       {
  36.        "ahk": [ahk_h, ahk_l],
  37.        //
  38.        "exe": uniextract,
  39.        //
  40.        "pdf": [sumatra, pdfx],
  41.        "txt": [nppp, emacs],  
  42.        //
  43.        "gif": imageviewers,
  44.        "jpg": imageviewers,
  45.        "png": imageviewers,
  46.        "ssc": imageviewers,
  47.        //
  48.        "avi": videoplayers,
  49.        "flv": videoplayers,
  50.        "mpg": videoplayers,
  51.        "mpeg": videoplayers,
  52.        "mp4": videoplayers,
  53.        "mov": videoplayers,
  54.        //
  55.        "7z": sevenzip,
  56.        "iso": [sevenzip],
  57.        "rar": sevenzip,
  58.        "tgz": sevenzip,
  59.        "zip": [sevenzip, uniextract]
  60.       };
  61.     // adding to all
  62.     // XXX: not worrying about duplicates atm
  63.     for (ext in table) {
  64.       rule = table[ext];
  65.       theType = typeof rule;
  66.       if (theType === "string") {
  67.         table[ext] = [rule].concat(addtoall);
  68.       } else if (theType === "object") {
  69.         table[ext] = table[ext].concat(addtoall);
  70.       } else {
  71.         // XXX: not expected...
  72.       }
  73.     }
  74.     //
  75.     return table;
  76.    })();
1383
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 05, 2012, 02:19 AM »
Hurray!  No crashes when starting up for both Windows XP Pro SP3 and Windows 7 Pro 64-bit :)

1384
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 05, 2012, 02:04 AM »
Attached, please find a first attempt at an OpenWith plugin.

Usage

  pane 0: some file name
  pane 1: Open With...
  pane 2: application name <-- see below for some notes on this

Some points:

  • Didn't figure out how to give results higher scores -- the added results appear to be quite a bit toward the end of the results
  • The paths of the applications are configured in the file associations.js
  • The paths of the applications are represented as JavaScript strings and backslashes need escaping
  • The paths of the applications use relative paths
  • Some items like hashmyfiles won't work because it actually requires command line switches, e.g. /file <filename>
  • Lots of output statements in the code for testing / debugging purposes

example association.js (what's included)
Code: Javascript [Select]
  1. table =
  2.   (function () {
  3.     var table,
  4.         ahk_l, emacs, gimp, hashmyfiles, nppp, pdfx, sevenzip, sumatra,
  5.         uniextract, xnview,
  6.         imageviewers;
  7.     //
  8.     ahk_l = "..\\AutoHotkey_L\\AutoHotkey.exe";
  9.     emacs = "..\\emacs\\bin\\runemacs.exe";
  10.     gimp = "..\\GIMPPortable\\GIMPPortable.exe";
  11.     hashmyfiles = "..\\NirLaunchers\\NirSoft\\hashmyfiles.exe";
  12.     nppp = "..\\Notepad++Portable\\Notepad++Portable.exe";
  13.     pdfx = "..\\PDFX_Vwr\\PDFXCview.exe";
  14.     sevenzip = "..\\7-ZipPortable\\7-ZipPortable.exe";
  15.     sumatra = "..\\SumatraPDFPortable\\SumatraPDFPortable.exe";
  16.     uniextract = "..\\uniextract\\UniExtract.exe";
  17.     xnview = "..\\XnViewPortable\\XnViewPortable.exe";
  18.     //
  19.     imageviewers = [gimp, xnview];
  20.     //
  21.     table =
  22.       {
  23.        "exe": uniextract,
  24.        //
  25.        "pdf": [sumatra, pdfx],
  26.        "txt": [nppp, emacs],  
  27.        //
  28.        "png": imageviewers,
  29.        "jpg": imageviewers,
  30.        "gif": imageviewers,
  31.        //
  32.        "7z": sevenzip,
  33.        "iso": [sevenzip],
  34.        "rar": sevenzip,
  35.        "tgz": sevenzip,
  36.        "zip": [sevenzip, uniextract]
  37.       };
  38.     return table;
  39.    })();

MD5: 17eef4789a9a064d15a7c4006d07776c
1385
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 04, 2012, 08:04 PM »
- I've also added a bunch of method on the qatapult object so those become availables for the collecter plugins as well.

Thanks!

Here's what I picked out of painter.js:

qatapult.getFocus()
qatapult.textmode
qatapult.getArgValue(i, "type") // i - pane number: 0, 1, 2; str - "type", "email", "text", "status"
qatapult.getQuery(i) // i - pane number
qatapult.argscount
qatapult.resultsvisible
qatapult.resultscount
qatapult.crawlprogress
qatapult.showmenu(x, y) // x, y - coordinates

and from snippets.collector.js:

qatapult.match(text, query)
results.expects('TEXT')
results.addObject('TEXT', text, {'key':l, 'text':l, 'icon':'plugins\\somewhere\\image.png'})
1386
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 04, 2012, 06:46 PM »
Thanks for the new version :)



Just a quick note regarding:

- The presence of a debugger should not be required anymore now either. I wasn't able to really test it as I have too many debuggers installed, it would be a chore to get rid of every one of them. It would be nice if you could report me if it's ok.

When I tried with what I think is the latest -- the Qatapult.exe with MD5 d2442ae8ea4a5a8d433a131083e36682 (Qatapult.zip MD5 8cd63377c7e6bda0c9cf017e191cbeb1) -- I still get a crash on start up using Windows XP Pro SP3.
1387
DC Gamer Club / Re: Microsoft Flight Simulator - Free!
« Last post by ewemoa on March 04, 2012, 02:49 AM »
Both look quite impressive!

Thanks for sharing :)
1388
Living Room / Re: When you make your 100'th Post
« Last post by ewemoa on March 04, 2012, 01:02 AM »
Most excellent, well-written, and...mysterious? ;)
1389
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 02, 2012, 05:34 PM »
Considering what you're trying to do I think you'll need an access to the current args available in the rule to display the appropriates verbs. I don't think it is doable with what's is available for plugins at this moment... unless you've found a trick ?

I haven't found a trick -- just trying to become familiar with what's currently possible :)
1390
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 02, 2012, 05:30 PM »
Thanks for taking a look.

Changing ForWriting to ForAppending made it so that I can now see non-blank queries.  Perhaps with ForWriting, the file was getting overwritten coincidentally always when the query was an empty string...

I've update the code posted before.
1391
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 02, 2012, 05:24 AM »
What does the query parameter to the collect function represent?  Does it correspond to what a user has typed for the currently focused pane?

When I used the typeof operator, I got back that query is a string, but when I try to see what the value is by writing it to a file, I think I'm seeing a blank value.  Code modified so that file is appended to -- and consequently non-empty query values also show up.

Below is some code trying to make its way toward becoming a plugin :)

Code: Javascript [Select]
  1. function collect(query, results) {
  2.   var fso, f, of, ForReading = 1, ForWriting = 2, ForAppending = 8;
  3.   //
  4.   if (!results.expects('TEXT')) {
  5.     return;
  6.   }
  7.   fso = new ActiveXObject("Scripting.FileSystemObject");
  8.   //
  9.   of = fso.OpenTextFile("plugins\\OpenWith\\log.txt", ForAppending, true);
  10.   of.WriteLine("query: " + query);
  11.   //
  12.   ext = pathToExtension(query);
  13.   if (ext === null) {
  14.     ext = "NONE";
  15.   }
  16.   //
  17.   of.WriteLine("ext: " + ext);
  18.   of.close();
  19.   //
  20.   f = fso.OpenTextFile("plugins\\OpenWith\\" + ext + ".txt");
  21.   //
  22.   while (!f.AtEndOfStream) {
  23.     l = f.ReadLine();
  24.     if (qatapult.match(l, query)) {
  25.       results.addObject('TEXT', l, {'key': l, 'text': l});
  26.     }
  27.   }
  28.   f.Close();
  29. }
  30.  
  31. function pathToExtension(path) {
  32.   var ma;
  33.   ma = /\.([^\\.]*)$/.exec(path);
  34.   if (ma === null) {
  35.     return null;
  36.   }
  37.   return ma[1];
  38. }
1392
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 02, 2012, 04:47 AM »
I hope that means you have an idea of how to fix it :)

An additional data point -- similar situation with Windows XP Pro SP3: crash without Script Debugger installed, and no crash with Script Debugger installed.
1393
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 02, 2012, 04:21 AM »
I installed script debugger as you suggested and there is no crash now -- at least on Windows 7 Pro 64-bit.

I tried uninstalling script debugger and starting Qatapult -- it crashed again on start up.
1394
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 02, 2012, 03:22 AM »
FWIW, the following is the set up I have currently:

qatapult-with-snippets.png

I've tried downloading both Qatapult.zip and snippets.zip with a different browser, but the results have been the same -- crash at start up.
1395
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 01, 2012, 10:02 PM »
Tested with Windows 7 Pro 64-bit and also experienced crash on start up.
1396
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 01, 2012, 06:30 PM »
New extension mechanism looks interesting!

Downloaded and installed latest Qatapult.zip and placed uncompressed content of snippets.zip in plugins folder -- as hinted at by the posted .js:

Code: Javascript [Select]
  1. var f=fso.OpenTextFile("plugins\\snippets\\text.txt");

Qatapult crashes on start up though -- this was with XP Pro SP3.
1397
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on March 01, 2012, 01:24 AM »
The subtle background is nice too
do you mean the transparency - i'm not following that bit

I think so.  The way the image came across to me was that underneath the text mode edit field was the image of a globe along with corresponding text.

Thus one gets a reminder of the object type displayed previous to entering text mode.
1398
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on February 29, 2012, 08:52 PM »
I miss the change in color of the area where the text is typed in a pane -- so it looks like a text edit field:

qs-text-mode.jpg

The subtle background is nice too -- presumably of the object's default image.

May be this will be possible at some point?
1399
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on February 29, 2012, 08:49 PM »
Also it would be cool if there was a way of setting a hint or something as with this approach i can not think of a way to notify the user what goes where in the GUI (IE s/he would need to know the order is > URL > NAME. ). Theres no "un-documented" way to set the text at the top (indexing) or preferably bottom (path) is there ?  :D

Some kind of status text does sound nice.

For comparison...

QS

qs-shown.jpg

Option in FARR

farr-custom-window-titlebar.png
1400
Ecaradec's Software / Re: Qatapult
« Last post by ewemoa on February 28, 2012, 07:37 PM »
The first and the last rule in the bookmark plugin is a 4 items rule. I think that's your issue ewemoa, but I don't know what's the purpose of that 4th argument. It doesn't seem used.

May be pigeonlips could clarify :)
Pages: prev1 ... 51 52 53 54 55 [56] 57 58 59 60 61 ... 113next