 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
jonny
Joined: 13 Nov 2004 Posts: 3005 Location: Minnesota
|
Posted: Sun Jan 14, 2007 1:08 am Post subject: |
|
|
This:
| Code: | | Send, {TAB}{TAB}{TAB}{TAB}{TAB}{TAB} |
Could also be this:
|
|
| Back to top |
|
 |
fncll
Joined: 22 Oct 2005 Posts: 2
|
Posted: Sun Feb 11, 2007 5:16 am Post subject: no activity at all? |
|
|
| I downloaded this script an hour ago, I have a the folder setup with some favorites and using the default configuration, but nothing happens no matter when File Open dialog I try. How can I troubleshoot? Other AHK scripts seem to run fine... running 1.0.46.07 and Win XP |
|
| Back to top |
|
 |
catweazle Guest
|
Posted: Mon Mar 12, 2007 11:50 pm Post subject: X-Mouse interference? |
|
|
I've set the hotkey for the favorites menu as follows:
f_Hotkey1 = ^RButton Up
This mostly works fine, with the menu typically being displayed at the point where I press and release control+rbutton.
However, sometimes the mouse pointer mysteriously moves a long way from the menu just as the menu appears, which is quite annoying.
I use the TweakUI "X-Mouse" powertoy, which allows me to switch focus by moving the mouse into windows without needing to click, and this seems to be contributing to the problem. If I disable X-Mouse, Favorites.ahk seems to work correctly without this occasional strange, mouse warping.
I've tried various things:
Using the middle button, I still get the problem.
Removing the "Up" from the key binding, I still get the problem.
Changing the X-Mouse "activation delay" to something ridiculously large, I still get the problem.
Any ideas on how to work around this (and still use X-Mouse )?
I did try EXAMPLE #3 from the autohotkey Menu documentation, and this didn't display the problem. Perhaps it's due to some odd timing interaction?
Thanks,
John. |
|
| Back to top |
|
 |
Knowbodynow
Joined: 26 Jun 2007 Posts: 28
|
Posted: Sun Jul 08, 2007 4:39 am Post subject: Combining with Keyboard shortcuts? |
|
|
Hello, I have assigned the F12 key to bring up the favourites menu. I imagined that in my main AutoHotKey script I could do something like:
| Code: |
^0:: sendplay {F12} {down 2} {enter}
|
I thought this would bring up the menu select an item on it an execute it. But it isn't evoking the menu. I must be doing something wrong. Is there anyway to automatically select favourite menu items by using keyboard shortcuts?
Thanks,
CaH |
|
| Back to top |
|
 |
Knowbodynow
Joined: 26 Jun 2007 Posts: 28
|
Posted: Sun Jul 15, 2007 6:06 am Post subject: |
|
|
| Hello, I still haven't figured out how to get keyboard shortcuts working directly. Is it possible? I also have another question. Is it possible to have the direct links appear first and the folder links come underneath these? I tired editing the file but couldn't find a way to change the order in which these links appear. |
|
| Back to top |
|
 |
savage
Joined: 02 Jul 2004 Posts: 205
|
Posted: Tue Jul 17, 2007 8:54 pm Post subject: |
|
|
Well if all you want to do is use the script's "open path in various things" functionality you can just use this function. I just pulled the relevant bits out of the script and mashed them together but it seems to work right. (It's evolved a lot since I first wrote it )
| Code: | OpenPath( target )
{
WinGet, f_window_id, ID, A
WinGet, f_window_min, MinMax
If ( f_window_min == -1 ) ; Only detect windows not Minimized.
f_window_id =
WinGetClass, f_class, ahk_id %f_window_id%
If f_class in #32770,ExploreWClass,CabinetWClass,dopus.lister ; Dialog or Explorer.
ControlGetPos, f_Edit1Pos,,,, Edit1, ahk_id %f_window_id%
If f_AlwaysShowMenu = n ; The Menu should be shown only selectively.
{
If f_class in #32770,ExploreWClass,CabinetWClass ; Dialog or Explorer.
{
If f_Edit1Pos = ; The Control doesn't Exist, so don't display the Menu
Return
}
Else If f_class <> ConsoleWindowClass
{
IfNotInString, f_class, bosa_sdm_ ; Microsoft Office application
Return ; Since it's some other window type, don't display Menu.
}
}
; It's a dialog.
If f_class = #32770
{
If f_Edit1Pos <> ; And it has an Edit1 Control.
{
; Activate the window so that if the user is middle-clicking
; outside the dialog, subsequent clicks will also work:
WinActivate ahk_id %f_window_id%
; Retrieve any filename that might already be in the field so
; that it can be restored after the switch to the new folder:
ControlGetText, text, Edit1, ahk_id %f_window_id%
ControlSetText, Edit1, %target%, ahk_id %f_window_id%
ControlSend, Edit1, {Enter}, ahk_id %f_window_id%
Sleep, 100 ; It needs extra time on some dialogs or in some cases.
ControlSetText, Edit1, %text%, ahk_id %f_window_id%
Return
}
; else fall through to the bottom of the subroutine to take standard action.
}
; In Explorer, switch folders.
Else If f_class in ExploreWClass,CabinetWClass,dopus.lister
{
If f_Edit1Pos <> ; And it has an Edit1 Control.
{
ControlSetText, Edit1, %target%, ahk_id %f_window_id%
; Tekl reported the following: "If I want to change to Folder L:\folder
; then the addressbar shows http://www.L:\folder.com. To solve this,
; I added a {right} before {Enter}":
ControlSend, Edit1, {Right}{Enter}, ahk_id %f_window_id%
Return
}
; else fall through to the bottom of the subroutine to take standard action.
}
; Microsoft Office application
Else IfInString, f_class, bosa_sdm_
{
; Activate the window so that if the user is middle-clicking
; outside the dialog, subsequent clicks will also work:
WinActivate ahk_id %f_window_id%
; Retrieve any file name that might already be in the File name
; control, so that it can be restored after the switch to the new
; folder.
ControlGetText, text, RichEdit20W2, ahk_id %f_window_id%
ControlClick, RichEdit20W2, ahk_id %f_window_id%
ControlSetText, RichEdit20W2, %target%, ahk_id %f_window_id%
ControlSend, RichEdit20W2, {Enter}, ahk_id %f_window_id%
Sleep, 100 ; It needs extra time on some dialogs or in some case
ControlSetText, RichEdit20W2, %text%, ahk_id %f_window_id%
Return
}
; In a console window, CD to that directory
Else If f_class in ConsoleWindowClass,Console Main Command Window
{
WinActivate, ahk_id %f_window_id% ; Because sometimes the mClick deactivates it.
SetKeyDelay, 1 ; This will be in effect only for the duration of this ThRead.
IfInString, target, : ; It Contains a Drive letter
{
StringLeft, target_Drive, target, 1
Send %target_Drive%:{Enter}
}
Send, cd %target%{Enter}
Return
}
; Since the above didn't return, one of the following is true:
; 1) It's an unsupported window type but f_AlwaysShowMenu is y (yes).
; 2) It's a supported type but it lacks an Edit1 control to facilitate the custom
; action, so instead do the default action below.
Run, %target%,, UseErrorLevel
StringUpper, tmp, ErrorLevel
If ( tmp == "ERROR" )
MsgBox, 4096, Error, Could not open: %target%, 30
Return
} |
And you can use it simply:
| Code: | | F12::OpenPath( "C:\Command\Work" ) |
Enjoy! _________________ <enormous animated gif> |
|
| Back to top |
|
 |
savage
Joined: 02 Jul 2004 Posts: 205
|
Posted: Tue Jul 17, 2007 8:59 pm Post subject: |
|
|
As for putting folders after links, this version of BuildMenu should do the trick. Please bear in mind though that I only gave it a very cursory testing.
| Code: | BuildMenu( testPath, menu )
{
local MenuName, folderList, nextMenu, fileList, MenuItemName
local nameHash, incr, num, shortPath, len, varName
If Menu =
MenuName := testPath
Else
MenuName := Menu
If f_NotFirstTime = True
Menu, %MenuName%, DeleteAll
; Add all link files in this 'menuName' to the menu
Loop, %MenuName%\*, 0
fileList = %fileList%%A_LoopFileFullPath%`n
; Sort the fileList according to the number in the link comment field.
fileList := f_LinkSort( fileList )
shortPath := ShortenPath( MenuName )
pathHash := String2Hex( shortPath )
varName = f_MenuName[%pathHash%]
f_TestVarNameLength( varName )
array = f_MenuName[%pathHash%]
varName = f_MenuCount[%pathHash%]
f_TestVarNameLength( varName )
f_MenuCount[%pathHash%] = 0
Loop, Parse, fileList, `n
{
If A_LoopField =
{
Menu, %MenuName%, add
Continue
}
MenuItemName := FileShortName( A_LoopField, "last" )
; Build an array of menu names to check for duplicates now and in f_AddToFavorites.
num := f_MenuCount[%pathHash%]
incr = 0
Loop
{
If ( f_DuplicateItems( array, num, MenuItemName ) == 0 )
{
incr++
MenuItemName = %MenuItemName%%incr%
}
Else
Break
}
f_MenuCount[%pathHash%]++
num := f_MenuCount[%pathHash%]
Transform, %array%%num%, Deref, %MenuItemName%
; Build an array whose indices is the menu item name and contents is the full link file name.
nameHash := String2Hex( MenuItemName )
varName = f_fullName[%pathHash%][%nameHash%]
f_TestVarNameLength( varName )
Transform, f_fullName[%pathHash%][%nameHash%], Deref, %A_LoopField%
Menu, %MenuName%, add, %MenuItemName%, f_OpenFavorite
}
; Add a separator line only if there were any subfolders.
If %fileList%
Menu, %MenuName%, Add
; Add all subfolders to menu as submenus
Loop, %MenuName%\*, 2
folderList = %folderList%`n%A_LoopFileFullPath%
Sort, folderList
Loop, Parse, folderList, `n
{
If A_LoopField =
Continue
MenuItemName := FileShortName( A_LoopField )
nextMenu := BuildMenu(A_LoopField,"")
If nextMenu !=
Menu, %MenuName%, add, %MenuItemName%, :%nextMenu%
}
If fileList =
Return ""
Else
Return MenuName
} |
_________________ <enormous animated gif> |
|
| Back to top |
|
 |
Knowbodynow
Joined: 26 Jun 2007 Posts: 28
|
Posted: Thu Jul 19, 2007 4:08 pm Post subject: |
|
|
Thank you for both your replies. Moving the direct shortcuts to the top is good and the function for "open path in various things" is great. I used to use DirKey. For some reason this stopped working but it was very useful as pressing ctrl+alt+number would set a shorcut key and ctrl+number would execute it. The only thing, I think that now stops it from being perfect is not being able to over-write shortcuts. I know it is possible to edit the Favourites folder but it would be even better if it offered the choice to over-write a shortcut directly rather than saying that it was already in use. Still, the navigation pssobilities are awesome.
Best wishes,
CaH |
|
| Back to top |
|
 |
drmurdoch
Joined: 10 Nov 2006 Posts: 86
|
Posted: Sun Aug 26, 2007 10:08 pm Post subject: thanks for this script |
|
|
Love this. Very helpful.
Here is a screenshot
Note:
(1) see how the Favorites displayed in the menu (which you get to popup with a customizable hotkey) is created from this Favorites folder.
(2) submenus ..
(3) files and folders are allowed.
Thumbs up ! |
|
| Back to top |
|
 |
bedtimestory.com.au Guest
|
Posted: Sun Sep 02, 2007 6:47 am Post subject: Need an auto popup add to favourites code. |
|
|
can some one help me with an AUTOMATIC 'Add site to favourites' html code.
so no clicks and it asks you to 'add site' ok /cancel.
anyone. cheers. |
|
| Back to top |
|
 |
Knowbodynow
Joined: 26 Jun 2007 Posts: 28
|
Posted: Tue Jan 01, 2008 1:42 am Post subject: Dividing Lists Of Shortcuts |
|
|
Hello, happy new year! I'm trying to put dividing lines into my list of shortcuts. The introductory remarks say:
------------------------
; Order of items specified by putting 'menu=(integer)' anywhere in comment field
; of the shortcut. No spaces allowed. Not case sensitive.
; Seperator lines specified by putting 'menu=(integer) blank' anywhere in comment
; field of the shortcut. Spaces before 'blank' optional. Not case sensitive.
------------------------
But when I tried this by rightclicking the shortcut properties via Windows Explorer, the shortcut simply disappeared from the pop-up menu. Is there a way to get this working?
Thanks,
CaH |
|
| Back to top |
|
 |
CanuckGod
Joined: 26 Feb 2008 Posts: 1
|
Posted: Tue Feb 26, 2008 7:56 pm Post subject: |
|
|
| I'm loving this script, but cannot find a way to allow a held button press (for example, holding the middle button down for 1-2 seconds and then releasing) to work correctly to execute the menu popup; any attempts I have made to modify the code either result in the script terminating after one execution, or only working for one execution, and then only allowing the default hotkeys to work. If anyone could check it out and come up with a suggestion, I'd appreciate it greatly. |
|
| Back to top |
|
 |
Yordan
Joined: 06 Feb 2005 Posts: 7
|
Posted: Mon Mar 10, 2008 12:33 pm Post subject: |
|
|
Hi there!
Is it possible to define a list of window-titles where the favorite-menu should not be shown?
best regards,
Yordan |
|
| Back to top |
|
 |
infogulch
Joined: 27 Mar 2008 Posts: 64 Location: KC, MO
|
Posted: Mon May 12, 2008 3:11 am Post subject: |
|
|
Hi,
I noticed if the shortcut name contains an ampersand (&), it underlines the next character instead of displaying one. (i.e. a "&") That's how menus work, so I was just wondering if that was left on purpose so people can use keys they set up to navigate thru the menu, or what. If you don't think it needs to be "fixed", you might consider pointing it out at the top of the script. Just a thought. (I actually like the idea of using the "&" symbol for creating shortcut keys in the menu)
It would be awesome if menu icons were supported. Like in Menu Icons v2. A folder could have the folder icon, and any shortcuts use their set icon (or maybe the file it points to's standard icon. & maybe a submenu would have none?) Or is it possible to get the icon used by a shortcut? (under "Properties>Change Icon", is it possible to get that path?) Any way, I think that would be absolutely way cool if that could be added. But if not, maybe the menu style should be changed to not have that extra space for a checkmark or icon on the left of the menu names. | Code: | ;from MI.ahk refrenced above:
; Valid (and safe to use) styles:
; MNS_AUTODISMISS 0x10000000
; MNS_CHECKORBMP 0x04000000 The same space is reserved for the check mark and the bitmap.
; MNS_NOCHECK 0x80000000 No space is reserved to the left of an item for a check mark. |
Just some ideas.
2Yordan:
Yeah, sure. just add an #IfWin[not]Active and a group that you defined earlier to exclude classes or titles. (you might rather use classes - could be more reliable.)  _________________
 |
|
| 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
|