Welcome Guest.   Make a donation to an author on the site September 17, 2014, 02:41:32 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2010! Download 24 custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 ... 4 5 6 7 8 [9] 10 11 12 13 14 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Qatapult  (Read 64968 times)
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #200 on: March 02, 2012, 04:21:54 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.
Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #201 on: March 02, 2012, 04:30:47 AM »

Great, I know what's the issue now Wink
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #202 on: March 02, 2012, 04:47:08 AM »

I hope that means you have an idea of how to fix it smiley

An additional data point -- similar situation with Windows XP Pro SP3: crash without Script Debugger installed, and no crash with Script Debugger installed.
Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #203 on: March 02, 2012, 05:03:07 AM »

Yes, JScript debugger needs that you create interfaces for them to connect but they are only available if a debugger is available (nothing says that, that's just observations I learned latter from building fscript )
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #204 on: March 02, 2012, 05:24:22 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 smiley

Formatted for Javascript with the GeSHI Syntax Highlighter [copy or print]
  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. }
« Last Edit: March 02, 2012, 05:32:44 PM by ewemoa » Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #205 on: March 02, 2012, 06:32:32 AM »

That's strange, it works perfectly here. Try adding something like that at the top and check if that result is visible. You might also ask for the 'openwith (catalog )' to see all the results available at this point (expects return true in all cases when you enter the catalog ).

results.addObject('TEXT', 'XXX', {'key': 'XXX', 'text': query});

I think that you'll need to define an OPENWITH type so that you can write rules. I don't know if that was clear from my explanation. That way you'll be able to create rules like FILE,'open with',OPENWITH with a correct filtering.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #206 on: March 02, 2012, 06:36:16 AM »

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 ?
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #207 on: March 02, 2012, 05:30:54 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.
Logged
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #208 on: March 02, 2012, 05:34:40 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 smiley
Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #209 on: March 02, 2012, 06:56:33 PM »

No worry I'll add a getargvalue so that you get access to the other args. Of course this will make the source dependant of the rules.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #210 on: March 04, 2012, 04:26:03 PM »

I've uploaded a new version. That make me think that it would be really useful that I make something to notify of changes...

- You can now script your skins. Having played with it, I think it feels really flexible and powerful. It should be pretty simple to do an Alfred like skin, or do a white background for text editing. You can control the position of each texts and add custom text for individual types, etc... I've reworked the two demonstrations skin so that you can see how to port your skin. If you had made skin you'll need to port those to the new system, there is not too many skins yet and I'll can provide help as needed. The code is a bit long (for a skin ) but I've added variable for the size of the different elements to help you to get started. Have a look at painter.js in the skin folder.

- I've also added a bunch of method on the qatapult object so those become availables for the collecter plugins as well. Ewemoa you should be able to code your openwith plugin... I think you'll found all the features you need. I'll write an api reference but for the moment most methods are demonstrated in the painter.js and they are pretty straigthforward.

- 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.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #211 on: March 04, 2012, 06:46:53 PM »

Thanks for the new version smiley



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.
Logged
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #212 on: March 04, 2012, 08:04:15 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:

Quote
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:

Quote
qatapult.match(text, query)
results.expects('TEXT')
results.addObject('TEXT', text, {'key':l, 'text':l, 'icon':'plugins\\somewhere\\image.png'})
« Last Edit: March 05, 2012, 12:48:01 AM by ewemoa » Logged
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #213 on: March 05, 2012, 02:04:34 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)
Formatted for Javascript with the GeSHI Syntax Highlighter [copy or print]
  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

* OpenWith.zip (1.83 KB - downloaded 47 times.)
« Last Edit: March 05, 2012, 03:30:53 AM by ewemoa » Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #214 on: March 05, 2012, 02:07:13 AM »

I've found a mistake that is probably causing the crash. Could you try it again ewemoa ?

Scores configuration is not available yet, you're correct.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #215 on: March 05, 2012, 02:19:18 AM »

Hurray!  No crashes when starting up for both Windows XP Pro SP3 and Windows 7 Pro 64-bit smiley

Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #216 on: March 05, 2012, 02:56:35 AM »

Wuhuu !
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #217 on: March 05, 2012, 03:05:40 AM »

Hum, judging from the colors of icons it seems that I forgot an alpha premultiplication. If you have weird colors, this is it : I'll fix that this evening.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #218 on: March 05, 2012, 03:34:37 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.

Formatted for Javascript with the GeSHI Syntax Highlighter [copy or print]
  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.   })();
Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #219 on: March 05, 2012, 07:16:24 AM »

It seems that the colors are actually corrects. The new ugly "internet explorer" icon induced me in error. What's the hell were they thinking ? The colors are so awful that I supposed that I had broken something !!!
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ewemoa
Honorary Member
**
Posts: 2,419



View Profile Give some DonationCredits to this forum member
« Reply #220 on: March 05, 2012, 07:21:27 AM »

Perhaps one of the purposes was to attract attention...it seems there was some success in that...
Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #221 on: March 05, 2012, 08:42:53 AM »

Looking back again, still there is an issue : the run command looks really bad, so does others.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #222 on: March 05, 2012, 05:42:28 PM »

After another check, I think this is ok tongue . Pray that I don't change my mind in a few minutes.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
pigeonlips
Participant
*
Posts: 69


View Profile Give some DonationCredits to this forum member
« Reply #223 on: March 06, 2012, 02:27:05 PM »

Hi All,

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 wouldn't recommend using it as its far from finished, but i was hoping for a little help (or to find out whats possible)

Any hints on the following:



1 - any way of making the text in the input box a different size and color?

2 -

A) the results box background is white and i don't know how (or if) you can set a background. If i could then the skin could be something more classy than white. The ideal would be if i could make the background color transparent as that way there's less images to load for the skin.

B) is there any way of controlling the size of the results? This way i could fit more into results without the skin being very large.

3 - the text of the type TEXT always appears white at the bottom. I have no idea how to set this.

4 - you'll have to try the skin for this one but it would be nice to set some more properties depending on the type. Any way of finding out whats available by type in qatapult.getArgValue(0, "XXXX")
also Is it a bad idea to use code in the script to get other properties. I was thinking somthing like

if (last bit of filename = "mp3")
 show filename.album
 show filename.artist
 show filename.track

I'm not sure if this is ill advised as performance hit to qatapult is not what i want. I guess i might just have to try that one out.






* alfred-like.zip (5.93 KB - downloaded 31 times.)
Logged
ecaradec
Honorary Member
**
Posts: 408



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #224 on: March 06, 2012, 05:31:56 PM »

For text color you can use textcolor on the UI object. You can also use the fontfamily property to select a different font.

The results have a white background, its actually not a very good idea, I'll give an option to change the colors. Anyways I'll probably give control on the display of the results.
Results are 40 pixels high right now, I use the size given in drawresults to know how much I can fit in.

3. Uuuh ? I'm not sure about what you mean, I'll give a look at the skin tomorrow

4. Don't worry about the performance of getstring it's in memory, you'll run out of place on the skin before it get slow

I've found a little issue with the usage bonus on results. It seems ignored on files. Beyond that, I'm splitting this info so that I get exact number of uses and last data for improving the quality and learning of qatapult

I love the start of that skin Wink
« Last Edit: March 07, 2012, 06:31:11 AM by ecaradec » Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
Pages: Prev 1 ... 4 5 6 7 8 [9] 10 11 12 13 14 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.163s | Server load: 0.02 ]