| View previous topic :: View next topic |
| What's your opinion about adding these commands offically |
| These commands are completely useless |
|
11% |
[ 1 ] |
| These commands must be embraced asap |
|
55% |
[ 5 ] |
| Sounds good but will have bad influence upon performance |
|
33% |
[ 3 ] |
|
| Total Votes : 9 |
|
| Author |
Message |
heresy
Joined: 11 Mar 2008 Posts: 131
|
Posted: Thu Apr 17, 2008 3:57 pm Post subject: Improving Automation feature with On Event commands |
|
|
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 |
|
 |
Piz
Joined: 16 Feb 2008 Posts: 46
|
|
| Back to top |
|
 |
Rhys
Joined: 17 Apr 2007 Posts: 618 Location: Florida
|
Posted: Fri Apr 18, 2008 8:18 pm Post subject: |
|
|
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 |
|
 |
Piz
Joined: 16 Feb 2008 Posts: 46
|
Posted: Sat Apr 19, 2008 8:29 pm Post subject: |
|
|
| 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 |
|
 |
instantrunoff
Joined: 13 Jan 2008 Posts: 62
|
Posted: Mon Apr 21, 2008 1:36 am Post subject: |
|
|
| 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 |
|
 |
heresy
Joined: 11 Mar 2008 Posts: 131
|
|
| Back to top |
|
 |
Cirieno Guest
|
Posted: Thu May 01, 2008 11:21 am Post subject: having problems |
|
|
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
|
Posted: Thu May 01, 2008 6:14 pm Post subject: |
|
|
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 |
|
 |
Cirieno Guest
|
Posted: Thu May 01, 2008 7:31 pm Post subject: |
|
|
That worked, thankyou -- and sorry for posting in the wrong place  |
|
| Back to top |
|
 |
|