 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
freakkk
Joined: 29 Jul 2005 Posts: 169
|
Posted: Fri Jul 29, 2005 4:58 pm Post subject: Slave-- hotkey macro |
|
|
I've been using autoit/autohotkey to create little time saving scripts for myself for a long time now. This is really my first attempt at making a gui to interface w/ them-- thought i would share..
-----------------------------------------------------------------------------------
Working in a helpdesk type environment-- I found that too much of what I was doing was repetive. The data entry screen we use has its own built in macro editor-- but is limited in functions. I wrote this univeral macro editor to help automate everything repetetive I found myself doing.
-HOTKEYS:-
WIN+<1-9 & 0 (above letters & on side numeric keyboard)> -- These are set as 'hotkeys' that perform whatever action you assign it from built in editor.
-Actions-- Send keystrokes, minimize/maximize/resize windows, run programs/urls/anything you can create shortcut to, mouse clicking/moving..
.. setting a window function through built in editor..
.. now when you hit 'win+1' that window will be activated..
WIN+NUMERIC - (<--MINUS BUTTON ON NUMERIC PAD) -- Whenever hotkey is pressed-- it will take screenshot & save it as a JPG. (i used it to take these screenshots..)
-AUTOEXPAND:-
this allows you to set up keyboard triggers that magically expand when typed.
-AUTOCOMPLETE-
This allows you to create a custom dictionary of commonly used words or phrases. Whenever prog. dectects that you are trying to type one of those words-- it will show autocomplete (hit 'shift+enter' to accept..)
-- Download Slave 3.03.exe --
just put script in its own folder & run (screenshots are saved in that folder by default..)
--------------------------------------------------------------------------
I realize that there are already similar scripts posted on the forum. This was more a learning project for myself--
Let me know what you think... _________________ .o0[ corey ]0o.
Last edited by freakkk on Mon Dec 26, 2005 11:03 pm; edited 4 times in total |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10480
|
Posted: Sat Jul 30, 2005 12:20 pm Post subject: |
|
|
Nice screenshots. It looks like you've put together a nice framework for a macro/hotkey/hotstring assistant.
This is starting to look a little like the IDE (integrated development environment) some people have been asking about. Such a tool would basically be a GUI front-end for building general-purpose scripts.
Thanks for sharing it. |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5390 Location: /b/
|
Posted: Sat Jul 30, 2005 3:45 pm Post subject: |
|
|
| I like the many different features like screen capture - makes things easier thanks. |
|
| Back to top |
|
 |
Dragonscloud
Joined: 16 Jul 2005 Posts: 97
|
Posted: Sat Jul 30, 2005 9:19 pm Post subject: |
|
|
That is an awesome GUI, very professional-looking.
I was going to work on a front-end to AHK for hotstrings -on-the-fly, but I don't think I'll bother now. Your script fills that functionality.
Excellent tool. Thanks for sharing it. _________________ “yields falsehood when preceded by its quotation” yields falsehood when preceded by its quotation. |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3841 Location: Bremen, Germany
|
Posted: Thu Aug 25, 2005 7:46 am Post subject: |
|
|
Hi freakk,
thanks for sharing.
| Quote: | | it will take screenshot & save it as a JPG. | what are you using to create jpg files? I assume you use Alt+Print to capture the window, right?
I'm looking for a possibility to capture jpg files. Additionally I would like only to cpture a region and not the whole window or screen. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
webber
Joined: 25 Aug 2005 Posts: 60
|
Posted: Fri Aug 26, 2005 3:40 am Post subject: very impressive ! |
|
|
one of the most impressive and useful tools I've seen. Especially like the screen shot grabber.
Suggestion/question:
----------------------
In the autocomplete, if more than one word has similar initial characters, is it possible to show a list of terms and allow user to select choice ? Making it more like intellisense ?
thanks for the tools.
 |
|
| Back to top |
|
 |
freakkk
Joined: 29 Jul 2005 Posts: 169
|
Posted: Sun Aug 28, 2005 3:13 am Post subject: |
|
|
toralf-
I was originally using a small cmd line app called 'clip2jpg.exe' that was posted by someone on forum (i believe it was bobo actually..)-- but for some reason I can't seem to find the original post now. All it did was convert contents of clipboard to filename you specify. Then when I decided to do the partial snapshot- I decided to use the cmd line options of irfanview.
http://www.irfanview.com/
Heres what I have in this script (there is plenty to cleanup & refine-- but it works.. )
| Code: |
;//////////////////// SCREENSHOT CAMERA /////////////////////////
; CUSTOMIZE PATH TO WHERE YOU HAVE IRANVIEW IS INSTALLED...
irfanviewPATH=C:\Program Files\IrfanView\i_view32.exe
; FOLDER TO SAVE JPG'S IN..
FOLDER=%A_ScriptDir%
; 1 FOR WINDOW & 0 FOR FULLSCREEN SNAPSHOTS
CAPTUREtype=0
;// WINDOW-SCREENSHOT (WIN+SUBTRACT ON NUMBERPAD..) //
#NumpadSub::
Gosub, SCREENSHOTprep
; Run i_view32.exe to trim screenshot that has been dumped to clipboard..
RunWait, `"%irfanviewPATH%`" /clippaste /convert=`"%FOLDER%\%PHOTONAME%.jpg`", , hide
SCREENSHOTcleanup:
PHOTONAME=
return
;------------------------------------------------------------------------------------
SCREENSHOTprep:
IfNotExist, %irfanviewPATH%
Goto, PROGRAMdoesntEXIST
; takes screenshot...
If CAPTUREtype=1
Send,!{PRINTSCREEN}
If CAPTUREtype=0
Send,{PRINTSCREEN}
; determines unique filename..
PHOTONAME=1
Loop,
{
IfNotExist, %FOLDER%\%PHOTONAME%.JPG
Break
IfExist, %FOLDER%\%PHOTONAME%.JPG
{
PHOTONAME++
Continue
}
}
return
;------------------------------------------------------------------------------------
;//// HOTKEY FOR CUTTING SECTION OF SCREEN (SHIFT+LEFT CLICK/DRAG) ////
Alt & LButton::
CoordMode, Mouse, Screen
If GETTINGarea<>1
{
GETTINGarea=1
MouseGetPos, Sxpos, Sypos
SetTimer, SCREENclipper, 10
Gosub, CREATEhighlightAREA
Hotkey, Alt & LButton UP, On
return
}
return
Alt & LButton UP::
If GETTINGarea=1
{
GETTINGarea=
Hotkey, Alt & LButton UP, Off
SetTimer, SCREENclipper, Off
Gui, 13:Destroy
ControlClick , , , , Left, 1, U
;msgbox, cutting section of screen..`nX=%Sxpos%, Y=%Sypos%`nWidth=%Expos%`nHeight=%Eypos%
Gosub, TAKEscreenshotAREA
return
}
return
;////////////////////////////////////////////////////////////////////////////////////
;// WINDOW AREA HIGHLIGHTING BOX //
CREATEhighlightAREA:
Gui, 13:+owner +AlwaysOnTop
Gui, 13:Color, 808080
Gui, 13:+Lastfound ; Make the GUI window the last found window.
WinSet, TransColor, 808080 120
Gui, 13:-Caption +Border
Gui, 13:Show, X%Sxpos% Y%Sypos% h0 w0, --[Highlighting Section Of Screen For Screen Capture]--
Return
;--------------------------------------------------
; TIMER FOR CUTTING WINDOW AREA FOR SCREENSHOT..
SCREENclipper:
CoordMode, Mouse, Screen
MouseGetPos, Expos, Eypos
EnvSub, Expos, %Sxpos%
EnvSub, Eypos, %Sypos%
WinMove, --[Highlighting Section Of Screen For Screen Capture]--,, %Sxpos%, %Sypos%, %Expos%, %Eypos%
return
;--------------------------------------------------
;// CREATING PARTIAL WINDOW SCREENSHOT.. //
TAKEscreenshotAREA:
TAKEscreenshotAREA=1
Gosub, SCREENSHOTprep
RunWait, `"%irfanviewPATH%`" /clippaste /crop=(%Sxpos%`,%Sypos%`,%Expos%`,%Eypos%)
/convert=`"%FOLDER%\%PHOTONAME%.jpg`", , hide
;msgbox, cutting section of screen..`nX=%Sxpos%, Y=%Sypos%`nWidth=%Expos%`nHeight=%Eypos%
Goto, SCREENSHOTcleanup
PROGRAMdoesntEXIST:
Msgbox, I'm sorry. Irfanview doesn't exist!
Exitapp
;///////////////////////// END OF SCREENSHOT CAMERA /////////////////////////////////
|
webber-
| Quote: | | In the autocomplete, if more than one word has similar initial characters, is it possible to show a list of terms and allow user to select choice ? Making it more like intellisense ? |
Currently I have it set up to only show one match at a time-- & pressing & releasing left/right shift scrolls up and down through other matches. I have toyed around w/ revamping it though.. & have considered having option to set how many matches you want to be able to see at a time. I am also planning on having better options for importing words to dictionary & ability to allow different wordlists and/or combinations of wordlists for specific windows. Right now I'm working on improving editor- & adding a bunch of new commands for use w/ hotkey macros.
Thanks for the feedback! _________________ .o0[ corey ]0o. |
|
| Back to top |
|
 |
webber
Joined: 25 Aug 2005 Posts: 60
|
Posted: Sun Aug 28, 2005 6:27 am Post subject: |
|
|
| Quote: | | Currently I have it set up to only show one match at a time-- & pressing & releasing left/right shift scrolls up and down through other matches. |
this is what I was missing
It might be easier to have something like left-shift/Ctrl left-shift for scrolling, or allow user to select scroll keys
thanks |
|
| Back to top |
|
 |
Thalon
Joined: 12 Jul 2005 Posts: 640
|
Posted: Sun Aug 28, 2005 5:53 pm Post subject: |
|
|
Applikation works fine!
@Chris
This applikation is also a good example for the performanceproblem of X-Button!
If I close the Gui via X-Button it takes several seconds.
If I use Okay or Cancel it works quite fast!
Thalon |
|
| Back to top |
|
 |
webber
Joined: 25 Aug 2005 Posts: 60
|
Posted: Tue Aug 30, 2005 5:43 am Post subject: need help with autoreplace |
|
|
can't seem to get the autoreplace to work with this string
| Code: |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" `n"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
The Exclamation mark seems to throw it off . I tried to escape it but no help there.
Any suggestions on how to get this to work in autoreplace ? _________________ winxp pro sp2
AHK v1.0.38.02
----------------------------------
One man's preacher is another man's terrorist |
|
| Back to top |
|
 |
freakkk
Joined: 29 Jul 2005 Posts: 169
|
Posted: Wed Aug 31, 2005 12:37 am Post subject: |
|
|
well-- if you use the auto expand (hotstrings..).. you can put this:
| Code: | | <{!}DOCTYPE html PUBLIC {"}-//W3C//DTD XHTML 1.0 Transitional//EN{"} `n{"}http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd{"}> |
i definately want to enhance the key syntax screen to allow more possibilities/symbols-- but i have the basics included.
as far as using auto replace; the way i have it set up right now.. it only really pays attention to letters. its main focus was for simple words or small phrases of words. i could try to improve its functionality-- but how often that sentence come up in conversation anyway!!
for now- statements like yours would work best w/ auto expand. _________________ .o0[ corey ]0o. |
|
| Back to top |
|
 |
webber
Joined: 25 Aug 2005 Posts: 60
|
Posted: Wed Aug 31, 2005 4:55 am Post subject: |
|
|
that works!
Sorry, I keep calling it "auto replace" but in your slave it is "auto expand"  _________________ winxp pro sp2
AHK v1.0.38.02
----------------------------------
One man's preacher is another man's terrorist |
|
| Back to top |
|
 |
webber
Joined: 25 Aug 2005 Posts: 60
|
Posted: Sat Sep 17, 2005 6:32 pm Post subject: shift keys conflict |
|
|
when scrolling through a list of words for autocomplete, there is a problem with pressing the shift key five times as it triggers "sticky keys" from windows.
Is there a place where I can change the scrolling effect to be something other than the shift keys ?
Extracting this from the exe makes for one very large hard to read ahk file. I presume it isn't all one big script in the source code, but is made up of include files. Is the source code for all of this available ?
.. _________________ winxp pro sp2
AHK v1.0.38.02
----------------------------------
One man's preacher is another man's terrorist |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2436
|
Posted: Sat Sep 17, 2005 7:26 pm Post subject: |
|
|
@webber: You could turn off the option to activate the sticky keys menu when shift is pressed 5 times...  |
|
| Back to top |
|
 |
webber
Joined: 25 Aug 2005 Posts: 60
|
Posted: Sat Sep 17, 2005 7:34 pm Post subject: |
|
|
| corrupt wrote: | @webber: You could turn off the option to activate the sticky keys menu when shift is pressed 5 times...  |
I don't see any place to do that _________________ winxp pro sp2
AHK v1.0.38.02
----------------------------------
One man's preacher is another man's terrorist |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|