AutoHotkey Community

It is currently May 25th, 2012, 10:40 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 167 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12  Next
Author Message
 Post subject:
PostPosted: January 14th, 2007, 1:08 am 
Offline

Joined: November 13th, 2004, 4:08 am
Posts: 2951
Location: Minnesota
This:
Code:
Send, {TAB}{TAB}{TAB}{TAB}{TAB}{TAB}


Could also be this:

Code:
Send, {TAB 6}


Report this post
Top
 Profile  
Reply with quote  
 Post subject: no activity at all?
PostPosted: February 11th, 2007, 5:16 am 
Offline

Joined: October 22nd, 2005, 1:59 am
Posts: 2
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: X-Mouse interference?
PostPosted: March 12th, 2007, 11:50 pm 
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.


Report this post
Top
  
Reply with quote  
PostPosted: July 8th, 2007, 4:39 am 
Offline

Joined: June 26th, 2007, 4:12 pm
Posts: 43
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 15th, 2007, 6:06 am 
Offline

Joined: June 26th, 2007, 4:12 pm
Posts: 43
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 17th, 2007, 8:54 pm 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
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 :shock:)

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>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 17th, 2007, 8:59 pm 
Offline

Joined: July 2nd, 2004, 11:53 pm
Posts: 207
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>


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 19th, 2007, 4:08 pm 
Offline

Joined: June 26th, 2007, 4:12 pm
Posts: 43
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject: thanks for this script
PostPosted: August 26th, 2007, 10:08 pm 
Offline

Joined: November 10th, 2006, 5:10 am
Posts: 110
Love this. Very helpful.

Here is a screenshot

Image

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 !


Report this post
Top
 Profile  
Reply with quote  
PostPosted: September 2nd, 2007, 6:47 am 
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.


Report this post
Top
  
Reply with quote  
PostPosted: January 1st, 2008, 1:42 am 
Offline

Joined: June 26th, 2007, 4:12 pm
Posts: 43
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 26th, 2008, 7:56 pm 
Offline

Joined: February 26th, 2008, 7:52 pm
Posts: 1
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2008, 12:33 pm 
Offline

Joined: February 6th, 2005, 11:33 pm
Posts: 8
Hi there!

Is it possible to define a list of window-titles where the favorite-menu should not be shown?

best regards,
Yordan


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 12th, 2008, 3:11 am 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
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) :D


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. :D 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.) :)

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 16th, 2008, 1:11 pm 
Offline

Joined: February 6th, 2005, 11:33 pm
Posts: 8
Works fine, thank you!


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 167 posts ]  Go to page Previous  1 ... 7, 8, 9, 10, 11, 12  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Yahoo [Bot] and 23 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