Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Slave-- hotkey macro


  • Please log in to reply
45 replies to this topic
freakkk
  • Members
  • 182 posts
  • Last active: Dec 16 2014 06:23 PM
  • Joined: 29 Jul 2005
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.
Posted Image
-Actions-- Send keystrokes, minimize/maximize/resize windows, run programs/urls/anything you can create shortcut to, mouse clicking/moving..
Posted Image

.. setting a window function through built in editor..
Posted Image

.. now when you hit 'win+1' that window will be activated..
Posted Image

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.
Posted Image

-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..)
Posted Image

-- 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...

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
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.

polyethene
  • Members
  • 5519 posts
  • Last active: May 17 2015 06:39 AM
  • Joined: 26 Oct 2012
I like the many different features like screen capture - makes things easier thanks.

Dragonscloud
  • Members
  • 96 posts
  • Last active: Jul 21 2010 08:33 PM
  • Joined: 16 Jul 2005
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.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Hi freakk,

thanks for sharing.

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
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

webber
  • Members
  • 129 posts
  • Last active: Aug 13 2011 06:45 PM
  • Joined: 25 Aug 2005
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.

:D
________
Ford Airstream History

freakkk
  • Members
  • 182 posts
  • Last active: Dec 16 2014 06:23 PM
  • Joined: 29 Jul 2005
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.. :) )

;//////////////////// 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-

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!

webber
  • Members
  • 129 posts
  • Last active: Aug 13 2011 06:45 PM
  • Joined: 25 Aug 2005

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
________
IPAD ACCESSORIES

Thalon
  • Members
  • 641 posts
  • Last active: Jan 02 2017 12:17 PM
  • Joined: 12 Jul 2005
Applikation works fine! Posted Image

@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

webber
  • Members
  • 129 posts
  • Last active: Aug 13 2011 06:45 PM
  • Joined: 25 Aug 2005
can't seem to get the autoreplace to work with this string

<!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 ?
________
EASY VAPE VAPORIZER

freakkk
  • Members
  • 182 posts
  • Last active: Dec 16 2014 06:23 PM
  • Joined: 29 Jul 2005
well-- if you use the auto expand (hotstrings..).. you can put this:
<{!}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. :D
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!! 8)
for now- statements like yours would work best w/ auto expand.

webber
  • Members
  • 129 posts
  • Last active: Aug 13 2011 06:45 PM
  • Joined: 25 Aug 2005
that works!

Sorry, I keep calling it "auto replace" but in your slave it is "auto expand" :oops:
________
HOW TO ROLL JOINTS

webber
  • Members
  • 129 posts
  • Last active: Aug 13 2011 06:45 PM
  • Joined: 25 Aug 2005
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 ?





..
________
Buy Vapor Genie

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
@webber: You could turn off the option to activate the sticky keys menu when shift is pressed 5 times... ;)

webber
  • Members
  • 129 posts
  • Last active: Aug 13 2011 06:45 PM
  • Joined: 25 Aug 2005

@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
________
Medical marijuana patients