Jump to content


Photo

[SOLVED] plugin system


  • Please log in to reply
4 replies to this topic

#1 Ronins

Ronins
  • Members
  • 115 posts

Posted 15 June 2012 - 07:05 AM

hey guys... m making a plugin system for my launchy kind of app. But i am stuck.

Basically i want to get a return value from run. I tried stdout but i guess i must be missing something.
So, here is the scenerio: My launchy app runs the plugin. And i want the plugin to return a value back to app.

Foe example, say the plugin is cal.exe
So i'll call cal.exe 12+13

and cal.exe will return me 25

here is the code i tried..

app (not the whole, just ahk script for it)
#Include, StdoutToVar.ahk
MsgBox, % StdoutToVar_CreateProcess("calcz.ahk 12+15")

and for the plugin calcz.ahk
Loop, %0%
{
    global param := %A_Index%
    break
}
FileAppend, %param%, *

A lil help please?

#2 Guests

  • Guests

Posted 15 June 2012 - 07:42 AM

OnMessage and other solutions? See <!-- m -->http://www.autohotke....html#variables<!-- m -->

#3 Lexikos

Lexikos
  • Administrators
  • 8844 posts

Posted 15 June 2012 - 09:04 AM

This worked for me:
if 0 > 0
    FileAppend test, *
else
    MsgBox % StdoutToVar_CreateProcess(A_AhkPath " """ A_ScriptFullPath """ 1") [color=green]; AutoHotkey.exe "Script.ahk" 1[/color]
Basically, calcz.ahk is not a valid executable file.

#4 Ronins

Ronins
  • Members
  • 115 posts

Posted 15 June 2012 - 09:07 AM

calcz.exe/ahk is just a scrpit taking in commandline parameters and then producing result of sum of 2 numbers.

#5 Ronins

Ronins
  • Members
  • 115 posts

Posted 15 June 2012 - 11:14 AM

HAHA, used controlsend to send info back to main script :D

Lol... working great now