SpicyKeys - use hotkeys to open or move/copy selected files in Windows Explorer

Post your working scripts, libraries and tools for AHK v1.1 and older
User avatar
spicy
Posts: 4
Joined: 28 Nov 2021, 00:54

SpicyKeys - use hotkeys to open or move/copy selected files in Windows Explorer

28 Nov 2021, 06:05

🌶️ SpicyKeys 🌶️

Download link and documentation: https://spicykeys.github.io/

With SpicyKeys, you can select file(s)/folder(s) in Windows Explorer and press a hotkey to either open them in a predefined program or move/copy them to a predefined destination.

The hotkeys are defined in the config file named "spicykeys.txt". Here's an example config:

F7 open C:\Program Files\VideoLAN\VLC\vlc.exe
^+f run C:\Program Files\Mozilla Firefox\firefox.exe
^!d move done
^!b copy D:\backup
^!k move !:\keep

Each line specifies a hotkey in AutoHotkey's format, what mode to use (open/run/move/copy), and either the path of the executable in open/run mode, or the path of the destination in move/copy mode.

Depending on its format, the move/copy destination can be within the current folder, or an absolute path, or it can keep all parent folders intact. Please see the website for more information about the destination format.

With the example config above:
  • F7 will open the selected file(s)/folder(s) in VLC
  • Ctrl+Shift+F will just run Firefox and ignore anything selected
  • Ctrl+Alt+D will move the selected file(s)/folder(s) to a folder named "done" within the current folder
  • Ctrl+Alt+B will copy the selected file(s)/folder(s) to "D:\backup"
  • Ctrl+Alt+K will move the selected file(s)/folder(s) to a folder named "keep" at the root of the same drive and keep all parent folders
After updating the config file, either run SpicyKeys again or right-click the tray icon and click "Update Config".

Thanks to teadrinker for the code to get the selected file(s)/folder(s) in Windows Explorer, and thanks to Rapte_Of_Suzaku for the code to move/copy using Windows’ built-in file operation system.
Last edited by spicy on 18 Apr 2022, 00:53, edited 1 time in total.
pgeugene
Posts: 39
Joined: 27 Jun 2019, 04:36

Re: SpicyKeys - use hotkeys to open or move/copy selected files in Windows Explorer

17 Dec 2021, 03:30

Hi,
Thank you for your script.
However after selected the folder or file and pressed the hotkeys to move it to another path, an error pop up.
If I click Yes to continue,it was still working properly.
Below is the error msg.
spicykey.jpg
spicykey.jpg (35.48 KiB) Viewed 2202 times
User avatar
spicy
Posts: 4
Joined: 28 Nov 2021, 00:54

Re: SpicyKeys - use hotkeys to open or move/copy selected files in Windows Explorer

18 Dec 2021, 17:46

Hi, thank you for letting me know about this error.

I've updated the code. Now that bit of code is in a Try block. Could you please download it again and let me know if this fixes it?
pgeugene
Posts: 39
Joined: 27 Jun 2019, 04:36

Re: SpicyKeys - use hotkeys to open or move/copy selected files in Windows Explorer

19 Dec 2021, 04:12

Hi,
Thank you for your fast replied.
Now it is working for both moving files and folder.
Tq
User avatar
spicy
Posts: 4
Joined: 28 Nov 2021, 00:54

Re: SpicyKeys - use hotkeys to open or move/copy selected files in Windows Explorer

19 Dec 2021, 04:38

Thank you for letting me know, I'm glad that fixed it.
BreakingMe
Posts: 5
Joined: 17 Feb 2022, 12:04

Re: SpicyKeys - use hotkeys to open or move/copy selected files in Windows Explorer

17 Feb 2022, 12:07

I tried this with !F7 move U:\FOLDER NAME\FOLDER NAME and the file vanished into thin air.
User avatar
spicy
Posts: 4
Joined: 28 Nov 2021, 00:54

Re: SpicyKeys - use hotkeys to open or move/copy selected files in Windows Explorer

14 Mar 2022, 12:05

BreakingMe, I am sorry! I would suggest using Voidtools Everything to search for the file name, in case it has moved somewhere unexpected.

I've never experienced this issue myself. Is there any more information you could give to help diagnose this issue? For example, do other files or directories work fine, or does "copy" mode work? Also, what version of Windows were you using? I have only tested it on Windows 10.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 81 guests