ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: go to parent folder with double-click

<< < (3/5) > >>

justice:
Ah use FileInstall to include the .ico in the compiled exe ;)

ak_:
Thanks Justice i didn't know about this command and it's kinda neat.

Ok, i tried to add a feature : when you go to parent folder, the folder you come from is automatically selected in the folder list.

It goes like this :


--- ---Menu tray, icon, daddyclick.ico ; remove this if you don't want to use custom tray icon
; DaddyClick
; see http://translatecz.svarz.cz/2007/05/en-doubleclick-to-close-window.html  for similar script
; or the various help pages on ControlSend etc.

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

~LButton Up::

If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
if ((class = "#32770" or class="CabinetWClass" or class="ExploreWClass") and IsSelected = 0) { ; if open/save dialog OR explorer
ControlGetText prevDir, ComboBox1, ahk_class #32770 ; gets the name of the current folder from the combobox
ControlSend,,{BS},ahk_id %ControlHwnd% ; sends backspace
Sleep 30
Loop, parse, prevDir
{
ControlSendRaw, SysListView321, %A_LoopField%, ahk_class #32770 ; sends letters from the previous folder's name one after another to reach folder quickly
ControlGet, testSelected, List, Selected, SysListView321, ahk_class #32770 ; checks selected folder
if (testSelected = prevDir) { ; if selected folder is the folder we come from
break
}

}
}

} else
{
; info about window/ control the mouse is hovering over
MouseGetPos,,,id,ControlHwnd,2
WinGetClass, class, ahk_id %id%
; checks if a file or folder is selected in the dialog box
ControlGet, IsSelected, List, Count Selected, SysListView321, ahk_id %id%
}
Return
I tested it 1500 times and it seems to be working :)

Two problems remain :

1- if you double-click the scrollbar (which can happen a lot, as i realised) it goes to parent folder. I have to find a way to exclude scrollbars (edit : i think a found something, i'll give it a try tomorrow)
2- With the new feature mentionned above, the script gets a little confused when there is no parent folder to go to (ie Desktop - it's the only case i guess), but no big deal. Just *not clean*.

ak_:
Hmmm, i had a look at it, it works pretty well in open/save dialogs, but is still very buggy in explorer windows.

By the way, i had to modify it a little so the "folder selection" stuff works :


--- ---Menu tray, icon, daddyclick.ico ; remove this if you don't want to use custom tray icon
; DaddyClick
; see http://translatecz.svarz.cz/2007/05/en-doubleclick-to-close-window.html  for similar script
; or the various help pages on ControlSend etc.

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

~LButton Up::

If (A_PriorHotKey = A_ThisHotKey and A_TimeSincePriorHotkey < 500) {
if ((class = "#32770" or class="CabinetWClass" or class="ExploreWClass") and IsSelected = 0) { ; if open/save dialog OR explorer
; retrieve current folder depending on the window class
if (class = "#32770"){
ControlGetText prevDir, ComboBox1, ahk_class %class%
}
if (class = "ExploreWClass" or class = "CabinetWClass") {
ControlGetText prevDir, Edit1, ahk_class %class% ; retrieve current folder from Edit1 field
StringGetPos, SlashPos, prevDir, \, R1 ; get position of last \
SlashPos += 2 ; add 2 to the position so StringMid works
StringMid, prevDir, prevDir, SlashPos ; get part of the string, from last \ to the end
}

ControlSend,,{BS},ahk_id %ControlHwnd% ; sends backspace
Sleep 50
Loop, parse, prevDir
{
ControlSendRaw, SysListView321, %A_LoopField%, ahk_class %class% ; sends letters from the previous folder's name one after another to reach folder quickly
ControlGet, testSelected, List, Selected, SysListView321, ahk_class %class% ; checks selected folder
if (testSelected = prevDir) { ; if selected folder is the folder we come from
break
}

}
}

} else
{
; info about window/ control the mouse is hovering over
MouseGetPos,,,id,ControlHwnd,2
WinGetClass, class, ahk_id %id%
; checks if a file or folder is selected in the dialog box
ControlGet, IsSelected, List, Count Selected, SysListView321, ahk_id %id%
}
Return

Not perfect though...

justice:
urlwolf found Pistachio which does this as well it seems (not tested myself).

ak_:
Pitaschio yeah i know it, that's the little software i'm refering to in my first message (i ran into it on Lifehacker some time ago), but i just realised i gave freecommander's url instead of the correct one ...

Actually Pitaschio does the double-click thing very well but also does a lot of things that i don't need, so i wanted to make my own script to gain a few ko of memory :) And Pitaschio doesn't select the folder after going to parent and i like this feature (Freecommander-like) :D

Anyway, it's a lot of fun trying to do this in AHK, i'm falling in love with this thing :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version