AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: December 8th, 2005, 7:40 pm 
Offline

Joined: December 1st, 2005, 7:04 pm
Posts: 37
Location: Los Angeles, CA
Heres a script I threw together - basically when you hit #space it starts an unobtrusive run tooltip, all the functions of the normal run command are there. To get an idea - hit #space and then type in c:\ - your contents for your c drive will be listed, then as you type it filters out the results. You can also use the down/up arrows to scroll through your results. Anyways, any feedback would be great, thanks!

Also, instead of hitting enter to open the command, you can also hit ctrl+e(edit selected file) ctrl+p(view selected properties) and ctrl+f(open a find window for the selected folder)

Code:
;quickrunner -jw
#space::
ToolTip, _
Sleep, 10
Tooltip, R_
Sleep, 10
ToolTip, Ru_
Sleep, 10
ToolTip, Run_
Sleep, 10
restartrun:
wingettitle, returntome, a
winactivate, ahk_class Shell_TrayWnd
commandline =
loop
{
list=
newlist=
dir=
key=
tempgram=
newcommandline=
keypressed =
errorlevel =
edit =
Transform, CtrlE, Chr, 5
Transform, CtrlP, Chr, 16
Transform, CtrlF, Chr, 6
stringreplace, dir, commandline, `n,
stringlen, is, commandline
StringGetPos, wis, dir, \ , R1
wis++
is-=%wis%
stringtrimleft, look, dir, %wis%
stringtrimright, dir, dir, %is%
ifexist, %dir%
{
list = `n-----------------------------------
loop, %dir%\*.*, 1
ifinstring, a_loopfilename, %look%
list = %list%`n%a_loopfilename%
Tooltip, Run:%commandline%_%list%
newlist = %list%
}
else
Tooltip, Run:%commandline%_%newlist%
Input, key, L1 B M, {space}{backspace}{esc}{down}{up}{left}
keypressed = %errorlevel%
if keypressed = endkey:up
loop, parse, newlist, `n
pos = %a_index%
if keypressed = endkey:down
pos = 3
if pos > 0
{
stringlen, is, commandline
StringGetPos, wis, commandline, \ , R1
wis++
is-=%wis%
stringtrimright, newcommandline, commandline, %is%
loop
{
loop, parse, newlist, `n
{
if pos = %a_index%
tempgram = %a_loopfield%
size = %a_index%
}
Tooltip, Run:%newcommandline%%tempgram%_%newlist%
Input, key, L1 B M, {space}{backspace}{esc}{down}{up}{left}
keypressed = %errorlevel%
if errorlevel != endkey:up
if errorlevel != endkey:down
break
if errorlevel = endkey:down
{
if pos <= %size%
pos++
if pos > %size%
pos = 3
}
if errorlevel = endkey:up
{
if pos > 2
pos--
if pos = 2
pos = %size%
}
}
pos = 0
commandline = %newcommandline%%tempgram%
stringreplace, commandline, commandline, `n, , All
}
if keypressed = endkey:left
{
Loop
{
StringGetPos, wis, commandline, \ , R1
stringlen, is, commandline
wis++
if wis = %is%
{
stringtrimright, commandline, commandline, 1
continue
}
break
}
is-=%wis%
stringtrimright, commandline, commandline, %is%
}
if key = %CtrlE%
{
edit = 1
break
}
if key = %CtrlP%
{
edit = 2
break
}
if key = %CtrlF%
{
edit = 3
break
}
if key = `n
break
if keypressed = Endkey:space
{
commandline = %commandline%%a_space%.
stringtrimright, commandline, commandline, 1
}
if keypressed = Endkey:backspace
stringtrimright, commandline, commandline, 1
if keypressed = Endkey:escape
break
else if keypressed != Endkey:space
commandline = %commandline%%key%
if commandline =
goto, restartrun
}
Tooltip
if keypressed != endkey:escape
{
stringreplace, commandline, commandline, `n, , All
if edit = 1
run, edit "%commandline%"
else if edit = 2
run, properties "%commandline%"
else if edit = 3
run, find "%commandline%"
else
run, "%commandline%"
Sleep, 1000
}
return

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2007, 8:36 pm 
That's the very cool; and that what i something looking for very desperately since very long. i have one issue; i can not use ping with command line, ping 127.0.0.1 will not work and not tested but telnet will also not work as well. Any idea?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2007, 10:18 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
pretty cool. I do use the run box alot, but I don't see any great advantage to this over the existing box. (except aesthetics).

nicely done.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: notsoobvious and 12 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