AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Improving Automation feature with On Event commands

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  

What's your opinion about adding these commands offically
These commands are completely useless
11%
 11%  [ 1 ]
These commands must be embraced asap
55%
 55%  [ 5 ]
Sounds good but will have bad influence upon performance
33%
 33%  [ 3 ]
Total Votes : 9

Author Message
heresy



Joined: 11 Mar 2008
Posts: 131

PostPosted: Thu Apr 17, 2008 3:57 pm    Post subject: Improving Automation feature with On Event commands Reply with quote

i think the biggest part of AutoHotKey is the automation.
so i thought like if autohotkey has condition monitoring(On Event) commands that working separately with built-in loop. many things could be done in quick and easier way. i know that it can be done with defined Functions unless i need to keep watching more than two things. i'll just show you the commands of my suggestion.

Below commands are working in same way.
monitor for specified thing and if changed go to specified label.

Code:
Example : On Var, Label

On       ;Monitor
Var      ;Var for changes
Label    ;if changed, go to label



On Var, Label
On File, Label[, Interval]
On Focus, Label
On ActiveWindow, Label
On WinExist, Label, WinTitle    ;=OnWinCreate       
On WinClose, Label, WinTitle             
On WinTitle, Label, Class       ;Watch for Wintitle
On WinSize, Label, WinTitle
On ControlList, Label, WinTitle ;contents of an window changed
On URL, Label[, Interval]
On Clipboard, Label             ;i know it's already there
On Message ,Label               ;just it would be good to change(or add) for syntax systemicity


there would be more cases.
what do you think?
Back to top
View user's profile Send private message
Piz



Joined: 16 Feb 2008
Posts: 46

PostPosted: Fri Apr 18, 2008 1:39 pm    Post subject: Reply with quote

I really like this idea. It also reminded me of something I've been meaning to request.
Back to top
View user's profile Send private message
Rhys



Joined: 17 Apr 2007
Posts: 618
Location: Florida

PostPosted: Fri Apr 18, 2008 8:18 pm    Post subject: Reply with quote

I like the idea as well. Some of them seem like they might be tough to implement, though. For example, how would On File handle network files?
_________________
Back to top
View user's profile Send private message
Piz



Joined: 16 Feb 2008
Posts: 46

PostPosted: Sat Apr 19, 2008 8:29 pm    Post subject: Reply with quote

Rhys wrote:
I like the idea as well. Some of them seem like they might be tough to implement, though. For example, how would On File handle network files?

I'm not sure even what On File would do exactly, but assuming that from the code's perspective there's no difference between network files and local files,* handling network files wouldn't be a separate issue.

*which is as it should be - high-level functionality shouldn't have to care about things like that.
Back to top
View user's profile Send private message
instantrunoff



Joined: 13 Jan 2008
Posts: 62

PostPosted: Mon Apr 21, 2008 1:36 am    Post subject: Reply with quote

This would be huge! It would be nice if people could extend the list of On possibilities. For example, there could be a folder On in the Autohotkey folder and every file therein could have a name that's the function and the contents would be the necessary message code to work (e.g., FirefoxURL for when a URL is opened in Firefox). This would be a boon, because OnMessage and WindowSpy is very confusing.
Back to top
View user's profile Send private message Visit poster's website
heresy



Joined: 11 Mar 2008
Posts: 131

PostPosted: Tue Apr 29, 2008 8:13 pm    Post subject: Reply with quote

i've made a library which will work same as this suggestion
if you're interest check here
_________________
let's support Wiki
automation helper for beginners
Back to top
View user's profile Send private message
Cirieno
Guest





PostPosted: Thu May 01, 2008 11:21 am    Post subject: having problems Reply with quote

Hi there. This seems to be an incredible script and very useful! -- except I'm having a problem and I'm not sure if it's my code or what.

I want an action to be performed when I open a Save As window from Notepad. I'm experimenting, so this is intentionally very simple, but not working. No error message, no response at all.

This is my code in the autohotkey.ahk file

Code:

#include c:\progra~1\autoho~1\scripts\functions.ahk

On_WinOpen("Save As", "AlertMe", 1, 0, 100)
   return
AlertMe:
   send I Am open
   ;send !e{Down}{Down}{Down}{Down}!n     ;// save files as UTF-8
   return


Do you think you can help? I have also tried using "ahk_class #32770" instead of "Save As", but it makes no difference.
Back to top
heresy



Joined: 11 Mar 2008
Posts: 131

PostPosted: Thu May 01, 2008 6:14 pm    Post subject: Reply with quote

your code seems nothing wrong. but don't change the filename.
change it back to On.ahk (so the scripts knows functions are in On.ahk)
and put in AutoHotKey\Lib directory (make if not exist)
then try again. (try to put msgbox command in the label to debug it)

and please it's Wishlist suggestion thread.
if you have any other question please go ahead in original thread
_________________
let's support Wiki
automation helper for beginners
Back to top
View user's profile Send private message
Cirieno
Guest





PostPosted: Thu May 01, 2008 7:31 pm    Post subject: Reply with quote

That worked, thankyou -- and sorry for posting in the wrong place Confused
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group