Extended Caplock Menu (Dopus Edition)

Hey y'all, I wanted to share this here, particularly because...

  • #1, I made it,
  • #2, to work with Directroy Opus! :grinning:

Extended Capslock Menu is a context menu I wrote in AutoHotkey v1.

It changes the way caplock operates by giving it 3 HOTKEY actions...

  • Single Tap will COPY
  • Double Tap will PASTE
  • Hold the key down will Open the Menu

You can toggle your capslock from the top menu item or with two built in hotkeys Ctrl + Capslock and Alt + Capslock



It's made to work on Selected\Highlight Text.

It will copy that text into the menu and from there you pick a menu item to...

  • save the selected text to a new text document
  • copy text to temp sticky note
  • search the web or your local machine (sends local search's to everything 1.5a)
  • modify CASE and text via formatting options
  • add simple code formatting around the text e.g. "quotes" or (parentheses) or %VarPercents%
  • append {+ add to clipboard}, multiply clips in a row, then save your clipboard as a text file
  • open none clickable web links in your web browser.
  • insert date and time
  • and more...

What makes this a special Dopus Edition?

After selecting a file path in a text document.
such as ... (and this will work from this post)
"C:\Program Files\GPSoftware\Directory Opus\dopus.exe"
or with system vars...
%programfiles%\GPSoftware\Directory Opus\dopus.exe
or "%systemroot%\notepad.exe"
and then from the Open\Run\Explore... Submenu.

The top 3 items, Open Folder, Run\Open file, & Copy File to Clipboard
will try sending their commands to Dopusrt before trying file explorer!

(copy file to clipboard will not work without Dopus. The other two might work with file explorer thou I haven't bothered to test them yet cause Dopus is just better :slight_smile: )

A few more SCREENSHOTS






RUNNING the menu

there are two options...

  1. Running Extended Capslock Menu.ahk file itself (recommended). If you do not have AHK installed I included the Portable Version in the download, just drag and drop the `.ahk' file onto the 'AutoHotkeyU64 - Shortcut.lnk' located in same folder.
  2. There's also an Extended Capslock Menu.exe for quick ease, thou ahks exes are limited with reading customizations of .ini files which I have not figured out. updateing software paths outside of their default install locations may not be recognized from the .exe

Addiontonally if you know AHK and want to edit the script yourself that can only be done through the .ahk

SETTINGS FILE

This menu will access a few optional 3rd softwares' in there default install locations, e.g. Dopusrt.exe, everthying64.exe, ditto.exe, etc.. (Ditto is a great clipboard manager, if y'all aren't using it you should check that too.)

All the 3rd party softwares are free, except for dopus, but if you're reading this here I dont need to talk you into it. :rofl:

If you have them installed somewhere else you have manually to update the path in the Extended Capslock Menu - GLOBAL SETTING.ahk file. Choose the Edit Settings File item from the Settings Submenu, it will open in Notepad, and look for the [PROGRAMS PATHS] heading, then copy\paste YOUR path to the 3rd party programs.

Links to any software used in the menu are on the about window.

If you are not using the other ones those menu items just won't do anything.

;*********IMPORTANT!!! *****************************************************
;************************* [PROGRAM PATHS] ******* IMPORTANT!!! ************
;*********IMPORTANT!!!******************************************************

ditto = C:\Program Files\Ditto\ditto.exe 

dopus = C:\Program Files\GPSoftware\Directory Opus\dopus.exe

dopusrt = C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe

everything15a = C:\Program Files\Everything 1.5a\Everything64.exe

notepadpp = C:\Program Files\Notepad++\notepad++.exe

textgrab = C:\Program Files\Text-Grab\Text-Grab.exe

textify = C:\Users\%A_UserName%\AppData\Local\Programs\Textify\Textify.exe

xnviewmp = C:\Program Files\XnViewMP\xnviewmp.exe

A Note about AutoHotkeys use of System Vars
For some reason even though AHK is windows automation program it has its own use of System Vars.
If you have something installed in your %UserProfile% that path should be formatted with the AHK Var, %A_UserName%, as such...
C:\Users\%A_UserName%\The Rest of\Your Path.exe

DOWNLOAD @ GITHUB

For more info and to download visit the Releases Page on the Github repo I made for Extended Capslock Menu.

Any Feedback here or as a github issue would be appreciated. there a still a few small bugs I'm working out and learning about. Input would be helpful and check for updates if you start using this menu!

Cheers

  • Xavier
8 Likes

Dear Xavier, I decided to try your menu but i never used AHK before. download v.2 (as v.1 is depricated) and saw your script uses v.1
Why? )))

I stayed with v1 on this menu because the syntax is easier and even thou v1 is "deprecated" its had 10+ years of stable development, its less buggy.

Keep in mind this menu if only working with simple copied text in your clipboard, nothing advanced is happening in the background, so v1 if more than adequate for what its doing.

I have both installed in my computer, v2 should be able to run this without issue.


Also, you don't need to install AHK to run this, a portable version of AutoHotkey v1 is included in the download. Just drag and drop the .ahk on the shortcut right about it and it will run without any installation.

The .exe will do the same but won't see customizations in the settings file until I learn some more about creating .ini files. That's on my todo list in a future update.

I've been working on this menu still. Its had a few updates sense posting here so if anyone is using it go get the newest bug fixes and new additions from the releases page on the github.


furthermore I want to gloat about loving dopus... here's an easy example why...

on the menu item to Copy [a selected] File\Folder...

using dopus its 11 lines of simple code... 4 of which are an error check to throw an option for explorer users. so 7 lines. and just 1 cmd made to dopusrt.exe. the tooltip is just fun fluff.

Try
 {
            Run, %dopusrt% /CMD Clipboard COPY FILE "%filetoclip%", , UseErrorLevel
            if (ErrorLevel)
            {
                throw ; poor lambs are not using the DOPE!
            }
            ToolTip, %filetoclip% ...`n... copied to your Clipboard with Directory Opus!`nPaste it anywhere you would normally would paste a File.
            Sleep, 2500
            ToolTip
	    return
}

I was about to stop here and leave it alone because it just worked like magic, but, its good to be inclusive? haha

SO NOW!!, for file explorer users.... its 61 lines with lots of errorlevel fuss that took hours bug check.

 catch ; If Directory Opus fails or is not installed, prompt the user to select a destination folder using COPY TO... popup
        {
            FileSelectFolder, destFolder, , 3, Select destination folder to copy to:
            if (destFolder != "")
            {
                if (InStr(FileExist(filetoclip), "D")) ; Check if selection is a directory
                {
                    SplitPath, dir, , lastFolder  ; Get the name of the directory
					lastfolder := RegExReplace(dir, ".*\\([^\\]+)\\?$", "$1")
                    ; msgbox, filetoclip:%filetoclip%`n`ndir:%dir%`n`nnamestem:%namestem%`n`nfilename:%filename%`n`next:%ext%`n`nlastfolder:%lastfolder%`n`nLine#: %A_LineNumber%
					
                    FileCreateDir, %destfolder%\%lastfolder% ; Create the destination directory if it doesn't exist
                    FileCopyDir, %filetoclip%, %destfolder%\%lastfolder%, 1 ; Copy the directory contents to the destination path
                    if (ErrorLevel)
                    {
                        ToolTip, Failed to copy directory:`n%filetoclip% to %destfolder%\%lastfolder%`n`nERR. Line#: %A_LineNumber%
                    }
                    else  
                    {
                        ToolTip, Directory copied to:`n%destfolder%\%lastfolder%
						
                    }
					sleep 2000
					tooltip
					restoreclipboard()
					return
                }
                else ; a file is selected
                {
                    FileCopy, %filetoclip%, %destFolder%\%filename%, 1 ; Copy file to destFolder
                    if (ErrorLevel)
                    {
                        ToolTip, Failed to copy file: %filetoclip% to`n%destFolder%\%filename%`n`nERR. Line#: %A_LineNumber%
                    }
                    else
                    {
                        ToolTip, File copied to:`n%destFolder%\%filename%
                    }
                }
                Sleep, 2000
                ToolTip
            } 
            else
            {
                ToolTip, Copy canceled by user.
                Sleep, 1500
                ToolTip
            }
			tooltip
            restoreclipboard()
            return
        }
    }
    else
    {
        ToolTip, ERR. File or Directory Not Found:`n%filetoclip%
        Sleep, 2000
        ToolTip
        restoreclipboard()
        return
    }
1 Like