Welcome Guest.   Make a donation to an author on the site October 20, 2014, 01:02:38 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.
 
Learn about the DonationCoder.com microdonation system (DonationCredits).
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: Prev 1 ... 7 8 9 10 11 [12] 13 14 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Qatapult  (Read 66811 times)
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #275 on: March 29, 2012, 05:40:42 PM »

No problem at all.  Please rename appropriately.
Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #276 on: March 29, 2012, 05:44:05 PM »

Just thinking that one of the common uses for setInput would be when you zip a file, or do something else with a file to reopen Qatapult with the ouput file focused.

Thanks for the example situation.

Along the lines of zipping / archiving, do you have any UI ideas how one might approach multiple files / folders being selected for zipping / archiving?  In QS, there was the "comma trick", but I'm wondering whether there might be better alternatives...
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 #277 on: March 29, 2012, 06:16:46 PM »

The comma trick seems good to me. I had a look to integrate that this WE. This is really a core change and there is well over 50 places where I must fix things, so I will really need some quiet time to plug that. I don't know what could make it better, I think that allowing Qatapult to be a drop target might be nice so that we could drop files directly from the explorer into Qatapult. I would certainly use that. If you have some other usage ideas, I'm listening.

As a status update, I'm doing two things right now :
- fix memory leaks (I unplugged my memory leak finder to find a bug and left it unplugged. Leaks are not easier to find in larger quantities Wink )
- implementing a paste using the new DynaWrapper code. I have working clipboard code for text already. I'm also discovering that this is not a very easy environnement to develop into, but may be it will be easier as I write more wrappers.



Logged

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



View Profile Give some DonationCredits to this forum member
« Reply #278 on: March 29, 2012, 07:12:49 PM »

The comma trick seems good to me. I had a look to integrate that this WE. This is really a core change and there is well over 50 places where I must fix things, so I will really need some quiet time to plug that. I don't know what could make it better,

I don't know about the aesthetics of it, but the following display idea came up:

1. Press comma
2. Current pane extends vertically (like a stack?)

Just a random thought smiley



Quote
I think that allowing Qatapult to be a drop target might be nice so that we could drop files directly from the explorer into Qatapult. I would certainly use that.

Same here!  Drop target would be great.  Also being able to drag from Qatapult would be nice too -- quickly find something with Qatapult for use elsewhere (until there's a plugin smiley ).



One thing that I've wanted in FARR is the ability to drop items on to an individual result.  I have FARR configured to use "Blank search shows files from launch history..." -- and I've wanted to use that as a kind of dock to drop items on to, but last I checked, this doesn't work.  So certainly would be nice to have this in Qatapult!



Quote
As a status update, I'm doing two things right now :
- fix memory leaks (I unplugged my memory leak finder to find a bug and left it unplugged. Leaks are not easier to find in larger quantities Wink )
- implementing a paste using the new DynaWrapper code. I have working clipboard code for text already. I'm also discovering that this is not a very easy environnement to develop into, but may be it will be easier as I write more wrappers.

Wishing you luck in these matters...



By the way, what do you think of the idea of a command history like in command line shells?  IIRC, in bash and other *nix shells, Control-P / Control-N is used for previous command / next command.

If there were hooks for a plugin to register to execute code upon certain key sequences as well as a chance to operate on command content before Qatapult executes the command, I'd be interested in writing a plugin for command history smiley
Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #279 on: April 04, 2012, 08:01:09 PM »

Do you mind if I change the name of setInput to setOutput ? I think it would be more appropriate.

On a related note regarding renaming -- I think in English, spelling for collector ends in 'or'.  When I did search, I found that in French there is a word that ends in 'er'.

May be you knew this already 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 #280 on: April 05, 2012, 06:33:58 AM »

Quote
I don't know about the aesthetics of it, but the following display idea came up:

1. Press comma
2. Current pane extends vertically (like a stack?)
I think, I'll let skins handle that. I was considering doing something similar to QS as a default : putting extra arguments icon under each items. But that's going to be totally customisable in others skins.

History is something you'd need probably more access that you currently have. The history I though was most interesting is an history of rules, I really think that objects are insufficient, you want to repeat an action usually, not get the previous object. However I totally like the idea, and this is going to find its way into Qatapult.

Collecter is a a mistake. Thanks.
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 #281 on: April 05, 2012, 05:13:44 PM »

I just spotted that autohotkey has a dll version http://www.autohotkey.net/~HotKeyIt/AutoHotkey/

Embedding that would allow to build scripts plugin directly with autohotkey.
Logged

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



View Profile Give some DonationCredits to this forum member
« Reply #282 on: April 05, 2012, 06:49:03 PM »

FWIW, AutoHotkey.dll is what I've been using for at least one earlier Qatapult plugin -- the Calculate one.

For reference, below is a bit from Calculate.ahk:

Formatted for Autohotkey with the GeSHI Syntax Highlighter [copy or print]
  1. ; XXX: ScriptText should have #Persistent and a function def
  2. ;      Pass the script's text using ScriptText
  3. ;      Pass the name of the function in using FuncName
  4. RunFuncInScriptWithInputText(ScriptText, FuncName, InputText)
  5. {
  6.  ; XXX: before didn't need to muck with path...
  7.  AhkDll := AhkDllThread(A_ScriptDir . "\..\AHK\AutoHotkey.dll")
  8.  ;OutputDebug, % "Script content: " . ScriptText
  9.  AhkDll.ahkTextDll(ScriptText)
  10.  OutputDebug, % "Value passing to script: " . InputText
  11.  Result := AhkDll.ahkFunction(FuncName, InputText)
  12.  OutputDebug, % "Script returned: " . Result
  13.  AhkDll.Terminate()
  14.  Return Result
  15. }
  16.  
  17. Calculate(InputText)
  18. {
  19.  FuncName := "Calculate"
  20.  ScriptText := "#Persistent`n`n"
  21.              . "#NoTrayIcon`n`n"
  22.              . FuncName . "()`n"
  23.              . "{`n"
  24.              . "  Result := " . InputText . "`n"
  25.              . "  Return % Result . A_Space`n" ; XXX: convert to string
  26.              . "}`n"
  27.  Result := RunFuncInScriptWithInputText(ScriptText, FuncName, InputText)
  28.  Result := RTrim(Result)
  29.  ; XXX: consider whether to modify trailing zeros
  30.  Return Result
  31. }

« Last Edit: April 05, 2012, 06:54:58 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 #283 on: April 09, 2012, 05:18:01 PM »

I've uploaded a new version. This is the ground for the future settings ui that should be more usable. You can now enable and disable plugins from the UI. There is also a ton of less memory leaks.

There are new functions that you can use by doing a require("lib/clipboard.js") : they are clip and paste. Paste can optionally take a text to paste. You can also do a sendinput but it's currently limited to printable characters only. If you feel like improving it, I'll be happy to take your version and put it in Qatapult.

Both functions are built with direct call to win32 dll from javascript using the dynamic wrapper. Have a look to clipboard.js in lib if you want to see what it looks like.

There is a new jsmath plugin that eval javascript as a way to evaluate mathematical expression. Start a query with = on the first pane to trigger it. It work well but doesn't handle the display exactly the way I would like : The perfect thing ihmo would be to have a custom display on the first pane that display both the expression and the result, then a second pane with the operation. The current thing use 3 panes. I think that it might  be worthwhile that we use some specially named values that skins could detect and handle display for a large number of types instead of handling types individually like we do today : skins could be more versatile that way ihmo.

I've also fixed the collecter things as ewemoa suggested => please use now collector.js for your plugins now.
Logged

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



View Profile Give some DonationCredits to this forum member
« Reply #284 on: April 09, 2012, 05:42:43 PM »

I've uploaded a new version. This is the ground for the future settings ui that should be more usable. You can now enable and disable plugins from the UI. There is also a ton of less memory leaks.

Thanks for the new version!

Just a quick note -- I no longer see "Quit" or "Reload".  This is with a fresh install on Windows XP SP3.

Any ideas?
Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #285 on: April 09, 2012, 05:48:22 PM »

There are new functions that you can use by doing a require("lib/clipboard.js") : they are clip and paste. Paste can optionally take a text to paste. You can also do a sendinput but it's currently limited to printable characters only. If you feel like improving it, I'll be happy to take your version and put it in Qatapult.

Both functions are built with direct call to win32 dll from javascript using the dynamic wrapper. Have a look to clipboard.js in lib if you want to see what it looks like.

There is a new jsmath plugin that eval javascript as a way to evaluate mathematical expression. Start a query with = on the first pane to trigger it. It work well but doesn't handle the display exactly the way I would like : The perfect thing ihmo would be to have a custom display on the first pane that display both the expression and the result, then a second pane with the operation. The current thing use 3 panes. I think that it might  be worthwhile that we use some specially named values that skins could detect and handle display for a large number of types instead of handling types individually like we do today : skins could be more versatile that way ihmo.

Looking forward to checking these bits out...however, I don't see them in the latest zip.  I tried downloading with 2 browsers but didn't notice any difference.  For reference, the MD5 of what I ended up with was:

  MD5: 7a416eb360fcbd53dcfc1e672f575839

What am I missing?
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 #286 on: April 09, 2012, 05:59:36 PM »

Oups, I forgot to say that I moved all Qatapult verbs under the Qatapult file : type Qatapult and look at the available verbs
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 #287 on: April 09, 2012, 06:02:37 PM »

Thanks for spotting the missing plugins, they were still excluded from the package. The last version should contain all of them.
Logged

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



View Profile Give some DonationCredits to this forum member
« Reply #288 on: April 09, 2012, 07:52:50 PM »

...the missing plugins, they were still excluded from the package. The last version should contain all of them.

I see them now.  Thanks!
Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #289 on: April 09, 2012, 07:56:55 PM »

I moved all Qatapult verbs under the Qatapult file : type Qatapult and look at the available verbs

I typed 'qatapult' (no quotes) and I see three results in pane 0:

  • qatapult.png
  • Qatapult.exe
  • qatapult

None of the associated verbs for any of these (in pane 1) appears to be 'Quit' nor 'Reload'.  May be I misunderstood?

FWIW, the currentversion.txt file contains:

  20120410010112

and MD5 of the zip file is:

  614f0ec74c5ccdf48b6af2574d341858
Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #290 on: April 09, 2012, 08:59:55 PM »

please use now collector.js for your plugins now.

FWIW, in the latest download, I see the following file names:

  • jsmath.collecter.js
  • putty.collecter.js
  • snippets.collecter.js
  • uninstall.collecter.js

Also, in Qatapult\Lib there is FileGetVersionInfo.ahk -- I think this is unnecessary.
Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #291 on: April 09, 2012, 09:11:39 PM »

There is a new jsmath plugin that eval javascript as a way to evaluate mathematical expression. Start a query with = on the first pane to trigger it.

I like that I get an immediate result displayed  Thmbsup

[copy or print]
=Math.sin(Math.PI)

Now how to get a history thing working...

BTW, any chance of functionality for clearing the current pane's input?  May be there is already something...
Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #292 on: April 09, 2012, 09:13:11 PM »

There are new functions that you can use by doing a require("lib/clipboard.js") : they are clip and paste. Paste can optionally take a text to paste. You can also do a sendinput but it's currently limited to printable characters only. If you feel like improving it, I'll be happy to take your version and put it in Qatapult.

Both functions are built with direct call to win32 dll from javascript using the dynamic wrapper. Have a look to clipboard.js in lib if you want to see what it looks like.

I found clibpboard.js and test.command.js in plugins\commands -- taking a look now.

Thanks for this example code.
« Last Edit: April 09, 2012, 09:18:23 PM by ewemoa » Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #293 on: April 10, 2012, 06:23:27 AM »

In plugins\commands\clipboard.js there are a few lines that I don't understand well.  Please explain what the following were meant to do:

Formatted for Javascript with the GeSHI Syntax Highlighter [copy or print]
  1.        for(var a in args[i]) { break; }

Formatted for Javascript with the GeSHI Syntax Highlighter [copy or print]
  1.        this.length+=desc[t].size;

For the second bit, I don't see any desc anywhere else in the file.  I see that Struct is defined in lib\stdutils.js, so may be I should be ignoring some or all of clipboard.js?
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 #294 on: April 11, 2012, 06:39:05 AM »

About the collecter plugins, I feared that people would copy plugins folder over the old one without deleting the previous one. That's what I do actually. I feared that it would lead to entries being duplicated so I just leaved collecter for the moment. However if you create a new plugin collector.js is the correct name to use. Just thinking about it, I think that I could let qatapult rename theses files for consistency.

Reload, Quit and Options should now appears under the Qatapult entry. Here is what I got :

Is it different from what you have ewemoa ?

I agree with you about the history ewemoa. I was considering doing a global history. May be there should be some way to narrow the history to things that have the same start as the current selection so that we could get an history of math results and an history of operations on some file.

You're right about clipboard.js. It should be there. It's actually useless as it's not loaded. It doesn't do anything. The whole code about clipboard is in test.command.js that I should probably rename. I probably considered that it should only be called by command plugins so there wasn't too much needs to put it available as a library. I'm not sure if that's a good choice.

Quote
this.length+=desc[t].size;
clipboard.js is actually useless, this code is incorrect.

Quote
for(var a in args) { break; }
This is a trick to have a take the value of the first available item. I iterate once then exits. It do that because I describe types of the Struct function as an array of object : [{key:value}]. This line allows me to get the name of the key. I don't know of any other way to get that in javascript.
Logged

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



View Profile Give some DonationCredits to this forum member
« Reply #295 on: April 11, 2012, 06:19:54 PM »

Thanks for the response smiley

Reload, Quit and Options should now appears under the Qatapult entry.

...

Is it different from what you have

Yes.  I get:

Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #296 on: April 11, 2012, 06:21:28 PM »

I was considering doing a global history. May be there should be some way to narrow the history to things that have the same start as the current selection so that we could get an history of math results and an history of operations on some file.

Narrowing / filtering history sounds like an interesting idea.  May be it's worth trying if it's easy to implement.
Logged
ewemoa
Honorary Member
**
Posts: 2,475



View Profile Give some DonationCredits to this forum member
« Reply #297 on: April 11, 2012, 06:45:17 PM »

Thanks for the explanations regarding the 2 bits of code.

Regarding the "for in" construct, I remember something about possible problems in some circumstances if hasOwnProperty is not used to check that an iterated key is not inherited.  I'm not sure of what the precise details are, but FWIW, the following is from the Options page of jshint:

Quote
This option requires all for in loops to filter objects' items. The for in statement allows for looping through the names of all of the properties of an object including those inherited throught the prototype chain. This behavior can lead to unexpected items in your object so it is generally safer to always filter inherited properties out as shown in the example:

for (key in obj) {
  if (obj.hasOwnProperty(key)) {
    // We are sure that obj[key] belongs to the object and was not inherited.
  }
}

For more in-depth understanding of for in loops in JavaScript, read Exploring JavaScript for-in loops by Angus Croll.

I wonder if it is relevant in this case.
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 #298 on: April 12, 2012, 06:15:06 AM »

Quote
Thanks for the explanations regarding the 2 bits of code.
No pb.

About the for in construct, yes it can be annoying if it match some extra properties defined on prototype object. I will avoid to do that, it is somewhat seen as a bad practice now because of such issues.
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 #299 on: April 12, 2012, 06:16:13 AM »

I think that your version of Qatapult.exe is old, it probably didn't copied correctly or something like that. The new version has an hi-resolution icon when you focus it.
Logged

Blog & Projects : Blog | Qatapult | SwiffOut | FScript
Pages: Prev 1 ... 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.074s | Server load: 0.08 ]