No problem at all. Please rename appropriately.
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.
)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.
).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)
- 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.

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

I don't know about the aesthetics of it, but the following display idea came up: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.
1. Press comma
2. Current pane extends vertically (like a stack?)
; XXX: ScriptText should have #Persistent and a function def
; Pass the script's text using ScriptText
; Pass the name of the function in using FuncName
RunFuncInScriptWithInputText(ScriptText, FuncName, InputText)
{
; XXX: before didn't need to muck with path...
AhkDll := AhkDllThread(A_ScriptDir . "\..\AHK\AutoHotkey.dll")
;OutputDebug, % "Script content: " . ScriptText
AhkDll.ahkTextDll(ScriptText)
OutputDebug, % "Value passing to script: " . InputText
Result := AhkDll.ahkFunction(FuncName, InputText)
OutputDebug, % "Script returned: " . Result
AhkDll.Terminate()
Return Result
}
Calculate(InputText)
{
FuncName := "Calculate"
ScriptText := "#Persistent`n`n"
. "#NoTrayIcon`n`n"
. FuncName . "()`n"
. "{`n"
. " Result := " . InputText . "`n"
. " Return % Result . A_Space`n" ; XXX: convert to string
. "}`n"
Result := RunFuncInScriptWithInputText(ScriptText, FuncName, InputText)
Result := RTrim(Result)
; XXX: consider whether to modify trailing zeros
Return Result
}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.
...the missing plugins, they were still excluded from the package. The last version should contain all of them.
I moved all Qatapult verbs under the Qatapult file : type Qatapult and look at the available verbs
please use now collector.js for your plugins now.
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.

=Math.sin(Math.PI)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.
for(var a in args[i]) { break; } this.length+=desc[t].size;this.length+=desc[t].size;clipboard.js is actually useless, this code is incorrect.
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.
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.
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.
Thanks for the explanations regarding the 2 bits of code.No pb.
Original address: https://www.donationcoder.com/forum/index.php?topic=29595.0