AutoHotkey Community

It is currently May 27th, 2012, 12:46 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: April 3rd, 2010, 8:24 am 
Offline

Joined: July 30th, 2009, 4:15 am
Posts: 36
Hello,

I find myself using window spy a lot. Is there a way to open it using a hotkey?

Thanx.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2010, 8:33 am 
How about?
Code:
^w::
SplitPath, A_AhkPath, , OutDir
Run, % OutDir "\AU3_Spy.exe"


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2010, 8:38 am 
Offline

Joined: July 30th, 2009, 4:15 am
Posts: 36
Yep. That's perfect. Thanks. :D


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2010, 8:57 am 
answer4u wrote:
How about?
Code:
^w::
SplitPath, A_AhkPath, , OutDir
Run, % OutDir "\AU3_Spy.exe"

I stumbled across this trick somewhere in the forums in the last few days, but cannot find it now. But it does work, and removes the need for SplitPath. (I just love one liners)
Code:
^w::  Run, %A_AHKPath%\..\Au3_spy.exe
^h::  Run, %A_AHKPath%\..\Autohotkey.chm


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 3rd, 2010, 9:03 am 
@better_answer4u - Nice :D - I didn't realize you could do that.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 5th, 2010, 10:31 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6074
Location: San Diego, California
Better answer still ?
Code:
;==================================================================
; active the AHK window spy and take a snapshot of the spy's date
;==================================================================
; if the spy is not already, open it. leave the spy open when done
;==================================================================

;==================================================================
; where to store the text data from AU3_Spy.exe
; The name of the file to be appended, which is assumed to be in
; %A_WorkingDir% if an absolute path isn't specified.
;==================================================================
datafile=text.txt
;==================================================================


delimiter=$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
ddelimiter:=delimiter delimiter "`n" delimiter delimiter "`n"


fileappend, %ddelimiter%, %datafile%
fileappend, `n`n`n, %datafile%

;msgbox %ddelimiter%

#singleinstance force
#Persistent
settitlematchmode 2
return

;==================================================================
; The snapshot is triggered by typing this hotkey
;==================================================================
#q:: ; use the Win-q hotkey, or modify as desired


;WinGetActiveTitle, Target
;msgbox %Target%


ifWinNotExist ahk_class AU3Reveal
{
  Run, %A_AhkPath%\..\AU3_Spy.exe, , min
}

WinWait, ahk_class AU3Reveal,, 12
if (errorlevel<>0)
{
  msgbox Couldn't start AU3_Spy.exe`n`nPress Ok to exit.
  return
}

  sleep, 500


; get the body of text that Window Spy has about current window
ControlGetText, OutputVar ,Edit1, ahk_class AU3Reveal

fileappend, %OutputVar%, %datafile%
fileappend, `n`n`n, %datafile%
fileappend, %ddelimiter%, %datafile%
fileappend, `n`n`n, %datafile%


;msgbox % OutputVar

;clipboard= %OutputVar%
  ;msgbox Data from AU3_Spy.exe copied to clipboard`n`nPress Ok to exit.

;msgbox % clipboard

return


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: chaosad, jrav, MSN [Bot] and 24 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group