Home
Download
Screenshots

Wiki
Plugins
Translations
Developers
Donate

Forums/Help
Contact Us

StrokeIt

Variables and logic

Posted by dapobe 
dapobe
Variables and logic
February 16, 2003 02:06PM
Hello

Is it posible to use logical variables in StrokeIt?

For example:

I have a gesture to play Winamp. But It would be useful to have a way to know if Winamp is in memory (Activate Window) or if it needs to be started (Start Program)

Or sometimes a different action needs to be performed depending if its the first time or second...

Is just an idea... General variables... If-then-else commands controlled by var... etc...


Dapobe
Jeff
Re: Variables and logic
February 17, 2003 01:00PM
I would *LOVE* to implement this, but it would be very difficult to do with the existing interface. If anyone has any good ideas on how to implement logic structures and variables without disrupting the current interface too much, I would be very interested in hearing them.

-- Jeff
Dale Hohm
Re: Variables and logic
February 18, 2003 01:19PM
Well, this is not full-fledged scripting, variables and flow control, but consider the following:

The basic requirement for implementing logic and flow control is that information or return values need to be maintained and passed from one command to the next. Using your existing UI design you could modify existing commands and add new ones such that a status, return value or literal string could be passed to the next command. The next command could be configured to accept this value being passed in and act upon it (or not).

Not comprehensive, but pragmatic.

Dale
Leo
Re: Variables and logic
February 28, 2003 07:41PM
Hi Jeff,

I think Girder [url=http://www.girder.nl]http://www.girder.nl[/url] and your program StrokeIt are very similar in the tree
structure and girder use lua script.
[url=http://www.lua.org]http://www.lua.org[/url]

Perhaps you can use it too ?!

[url=http://www.girder.nl/help/girderlua.php]http://www.girder.nl/help/girderlua.php[/url]

with best regards

Leo

Sango
Re: Variables and logic
March 02, 2003 08:45AM
I think a simple perl/python/ruby/dos-batch/...-skript is a better choice.

I use ruby and dos with the execute-command for those things and it's better than a optional implementation in strokeit, because, it's more mighty :)
Jeff
Re: Variables and logic
March 02, 2003 10:57AM
Here's what I have in mind at the moment:

- Rework the plugin handling code to allow some interplugin communication
- Allow plugins to call commands in other plugins
- Allow plugins to return values
- Allow plugins to have commands that are not available through the GUI.

Note: none of the plugin changes mentioned above will affect the GUI in any way, it's all just internal changes that will allow me to create a "Scripting" plugin that will embed a simple scripting language (Lua looks promising, thanks Leo)

- The scripting plugin will be text-based instead of a GUI. Where a normal plugin command would have its configuration stuff, the scripting plugin will probably just have a user-specified description of what the script does, a button to edit the script, and a settings button.

- Pressing the "edit" button will write the script to a file, and launch either the default text editor or, if specified, a user-chosen editor. The plugin will automatically detect changes in the file and reload whenever the file is saved in the editor.

- Pressing the "settings" button will allow the user to set the editor used to edit the script. There will probably be more settings here in the future.

- The scripting plugin will be able to call any function in any plugin (including the newly created type of commands that are not available through the GUI). This will allow developers to easily extend the scripting language to meet their needs.

Ultimately this will give us a scripting language that can do everything that StrokeIt can already do, and will add logic structures, loops, variables, and comparisons without disrupting the existing interface.

Please let me know what you think,

Jeff
Leo
Re: Variables and logic
March 02, 2003 04:21PM
Hi Jeff,

This sounds awesome.

I would love it.

with best regards

Leo
Anthony R.
Re: Variables and logic
July 24, 2003 12:57PM
How is this coming along...just curious
Jeff
Re: Variables and logic
July 24, 2003 04:06PM
To be honest, I haven't done anything with this yet. It's still planned, and certainly something I'd like to do, but I haven't had any time to work on it.

-- Jeff
Wade
Re: Variables and logic
November 29, 2003 08:58PM
I've solved this very nicely by using WinBatch (www.winbatch.com). It can do just about any multi-window function you can dream up. Most of my stroke-it commands just call a WinBatch macro which does the heavy lifting. For example, a trivially simple macro that either gives my FTP client focus or starts it if it isn't running looks like:

Quote

WINTEXT = "LeechFTP"
If WinExist(WINTEXT)
WinShow(WINTEXT)
WinActivate(WINTEXT)
else
Run("C:\Program Files\LeechFTP\Leechftp.exe", "")
EndIf

In a perfect world, it would be cool to integrate WinBatch right into StrokeIt, but I do just fine by running programs.

Wade
[url=http://www.wademan.com]http://www.wademan.com[/url]

Scott
Re: Variables and logic
November 30, 2003 11:40PM
From previously in the thread, it looks as though Lua is under heavy consideration.

-Scott
Author:

Your Email:


Subject:


Spam prevention:
Please, solve the mathematical question and enter the answer in the input field below. This is for blocking bots that try to post this form automatically.
Question: how much is 13 plus 11?
Message: