Tapatalk

More AHK Goodness - show list of project files

More AHK Goodness - show list of project files

23
Basic UserBasic User
23

    Feb 10, 2012#1

    Not sure if I just couldn't find a hotkey in the configuration or what, but I wanted to press Ctrl+L and see the searchable list of project files.

    In AutoHotkey ( https://www.autohotkey.com ):

    Code: Select all

    #IfWinActive, .*UltraEdit$
    
        ^l::
        {
    
     PostMessage, 0x111, 33195, 0, , A
     return
        }
    #IfWinActive
    

    6,685587
    Grand MasterGrand Master
    6,685587

      Feb 12, 2012#2

      I'm not sure which window you mean.

      UltraEdit has the command ProjectFilesSettings in the Key Mapping configuration dialog for assigning a hotkey to this command opening the project settings dialog where also the project files are listed.

      UEStudio has additionally the command IntellitipFileList in the Key Mapping configuration dialog for assigning a hotkey to the command which opens a small quick window listing the project files as the command File List in the IntelliTip toolbar opens.

      23
      Basic UserBasic User
      23

        Feb 12, 2012#3

        In the File View, Project tab you can right-click the project name and choose "list files in project," which pops a search/listview for you to narrow down files.

        I don't like having to use the mouse, so I used that AHK script to map it to the keyboard.

        Were you implying such easy access was only available in the UEStudio product? Because I code using UltraEdit and would hate to think there are little productivity enhancements in one product that could be carried back to another.

        6,685587
        Grand MasterGrand Master
        6,685587

          Feb 13, 2012#4

          Ah, now it is clear which window you mean. Yes, the command to open this window with the list of project files is available only in the context sensitive popup menu of the Project tab of the File Tree View (UE) respectively Workspace Manager (UES).

          The IntelliTips feature is not available in UltraEdit at all. The command IntelliTip file list lists also file names which are part of the project but not listed in the project settings dialog. Those files are included mainly with #include <includefile.h> and only the IntelliTips feature knows where such include files are located. Those files can be found in the standard library folder(s) of the used compiler. And UEStudio can find them automatically only if using a project template of UEStudio containing the specification of the standard library include paths. UltraEdit projects do not contain any compiler specific settings.

          44
          Basic UserBasic User
          44

            Feb 15, 2012#5

            Sweet! UltraEdit and AHK are two of my favourite all purpose "get things done tools" - thanks for this!

            Rob
            :)

            23
            Basic UserBasic User
            23

              Feb 15, 2012#6

              Mine too. I have infinity of scripts. Ahk has a very lively irc channel #ahk on irc.freenode.com

              I use a lot of scripts also outside of UE, which is why I generally don't write UE macros. Plus ahk lets you make quick and dirty GUIs. Nudge nudge UltraEdit scripting engine person ;)

              5
              NewbieNewbie
              5

                Jun 21, 2013#7

                Hi, I'm also a fan of both UE and ahk. I see you used #ifWinExist here to test if the active window is UE.
                Using the ahk spy, it seems that UE does not its own special ahkClass value to use in e.g.

                Code: Select all

                #IfWinActive ahk_class .... 
                If one wants to request this, which of IDM vs. Authotkey do you think one should contact?

                23
                Basic UserBasic User
                23

                  Oct 29, 2014#8

                  Make sure

                  Code: Select all

                  settitlematchmode, regex 
                  is set at the top, and then use this:

                  Code: Select all

                  #IfWinActive,ahk_class Afx:00400000.*
                  It does a partial match on the part of the UE class that doesn't change.

                  I've got a much larger script that's kind of muddled, but I use the following method for the SendMessage constants:

                  Code: Select all

                  ;---------------------------------------------------
                  ;	# Run app function (sendmessage)
                  ;---------------------------------------------------
                  SendApp(iConstant) {
                  
                  	SendMessage, 0x111, iConstant, 0,, A
                  }
                  
                  I use the following constants. Note that some are positional (I've used my own tool names for tools 1-5, but those correspond to the order of your tools)

                  Code: Select all

                  [Constants]
                  iConfiguration          = 32839
                  iCodeCommentAdd         = 33036
                  iCodeCommentRemove      = 33037
                  iCodeCommentSelected    = 41055
                  iCodeUnCommentSelected  = 41056
                  iColumn_ConvertToFixed  = 33108
                  iColumn_Number          = 32831
                  iEditDeleteActiveLine   = 32862
                  iEditBookmarkLine       = 32794
                  iSearchFindInFiles      = 32833
                  iFileName_Active_Copy   = 33038
                  iFileShowAs_AHK         = 34301
                  iFileShowAs_ASP         = 34316
                  iFileShowAs_CS          = 34302
                  iFileShowAs_CSS         = 34303
                  iFileShowAs_DotNet      = 34304
                  iFileShowAs_INI         = 34305
                  iFileShowAs_Javascript  = 34306
                  iFileShowAs_JSON        = 34307
                  iFileShowAs_MySQL       = 34308
                  iFileShowAs_None        = 34319
                  iFileShowAs_Perl        = 34309
                  iFileShowAs_PHP         = 34310
                  iFileShowAs_Python      = 34311
                  iFileShowAs_Raider      = 34312
                  iFileShowAs_SQL         = 34313
                  iFileShowAs_TTUHSC      = 34314
                  iFileShowAs_UWC         = 34315
                  iFileShowAs_VB          = 34317
                  iFileShowAs_XML         = 34318
                  iFileSort               = 32871
                  iFileSaveAll            = 32815
                  iProjectFile_Edit       = 65512
                  iProjectFile_Refresh    = 32781
                  iProjectFile_Search     = 33195
                  iProjectTool_SQLCommand = 33094
                  iTemplates_Rename       = 11119
                  iThemeOrganizer         = 13000
                  iTemplates_Rename       = 11119
                  iTools_1                = 32785
                  iTools_AHK_Run          = 32875
                  iTools_UWC_SQL          = 33092
                  iTools_Raider_SQL       = 33093
                  iTools_2                = 32786
                  iTools_3                = 32877
                  iTools_4                = 32878
                  iTools_5                = 32879
                  iTools_6                = 32880
                  iTools_7                = 32881
                  iTools_OpenActive       = 32881
                  iWindow_Close           = 65289
                  iView_XML               = 3298
                  iFormat_XMLCRLF         = 33332
                  iCodeCommentAdd         = 33036
                  iCodeCommentRemove      = 33037
                  iCodeCommentSelected    = 41055
                  iCodeUnCommentSelected  = 41056
                  iColumn_ConvertToFixed  = 33108
                  iColumn_Number          = 32831
                  iConfiguration          = 32839
                  iEditDeleteActiveLine   = 32862
                  iFileName_Active        = 33038
                  iFileSaveAll            = 32815
                  iFileShowAs_AHK         = 34301
                  iFileShowAs_ASP         = 34316
                  iFileShowAs_CS          = 34302
                  iFileShowAs_CSS         = 34303
                  iFileShowAs_DotNet      = 34304
                  iFileShowAs_INI         = 34305
                  iFileShowAs_Javascript  = 34306
                  iFileShowAs_JSON        = 34307
                  iFileShowAs_MySQL       = 34308
                  iFileShowAs_None        = 34319
                  iFileShowAs_Perl        = 34309
                  iFileShowAs_PHP         = 34310
                  iFileShowAs_Python      = 34311
                  iFileShowAs_Raider      = 34312
                  iFileShowAs_SQL         = 34313
                  iFileShowAs_TTUHSC      = 34314
                  iFileShowAs_UWC         = 34315
                  iFileShowAs_VB          = 34317
                  iFileShowAs_XML         = 34318
                  iFileSort               = 32871
                  iFormat_XMLCRLF         = 33332
                  iProjectFile_Edit       = 65512
                  iProjectFile_Refresh    = 32781
                  iProjectFile_Search     = 33195
                  iProjectTool_SQLCommand = 33094
                  iSearchFindInFiles      = 32833
                  iTemplates_Rename       = 11119
                  iThemeOrganizer         = 13000
                  iTools_1                = 32785
                  iTools_2                = 32786
                  iTools_3                = 32877
                  iTools_4                = 32878
                  iTools_5                = 32879
                  iTools_6                = 32880
                  iTools_7                = 32881
                  iTools_OpenActive       = 32881
                  iView_XML               = 3298
                  iWindow_Close           = 65289
                  
                  I do some custom coding now and again for baby money, so if you need something specific, let me know. I'm happy to help with the general things for free when I have time.

                  3
                  NewbieNewbie
                  3

                    Aug 28, 2018#9

                    Hello!

                    How were you able to determine value of 33195 for that specific action "List files in project..."?

                    I would like to have another hotkey that would "Select Active File", but I don't know what would be the value to pass into the PostMessage.

                    Thanks

                    6,685587
                    Grand MasterGrand Master
                    6,685587

                      Oct 27, 2018#10

                      Hi Guidam,

                      Tools like Resource Hacker can be used to find out the identifier number of a resource like a popup menu item.

                      But the context menu of the project in tab Project of File View is something special because it is dynamically constructed from popup menu and string resources. Most of these resources are in ueres.dll, but some are in executable of UltraEdit, i.e. uedit32.exe or uedit64.exe. The last menu item Select active file is a string from a string table resource in UltraEdit executable while most other items like List files in project... are from a popup menu resource in ueres.dll, whereby the popup menu resource contains the string Open File in Project... with identifier number 33195 instead of List files in project....

                      The string Select active file has the resource identifier number 61465. I don't know if this is also the identifier number used for the dynamic popup menu item, but I think so as it would explain the wrong prompt text in status bar for this menu item. Try it out if this number works in your AutoHotkey script.
                      Best regards from an UC/UE/UES for Windows user from Austria

                      3
                      NewbieNewbie
                      3

                        Nov 19, 2018#11

                        Thank you Mofi 
                        This works as expected.
                        I will take a closer look to Resource Hacker later, but for now I'm really glad with your complete answer