Help with Multi Folder Script

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
Juan Gabriel Moya
Posts: 2
Joined: 24 Mar 2023, 21:24

Help with Multi Folder Script

Post by Juan Gabriel Moya » 25 Mar 2023, 08:08

Hi Everyone,

I've been watching your videos about AutoHotKey but I'm a beginner yet and I think It will take a long time for understanding and make my own scripts. Thing is I need just now resolve the next problem:

1. I Have a Music Folder. Inside I have several Sub Floders named like "Billy Joel - Greatest Hits". Because I have several albums for same artist I could have another "Billy Joel - Greatest song, etc.
2. I Need create a new folder with just artist name (Text to the right of " - "
3. Then I nedd put inside this folder all folder beginning with this artist name (Name of the new folder)
4. I need to erase the name of the artist in moved folders so result in for example "Greatest Hits"

I've trying several ways but im stocked. So I will thank you so much your help.

User avatar
mikeyww
Posts: 26885
Joined: 09 Sep 2014, 18:38

Re: Help with Multi Folder Script

Post by mikeyww » 25 Mar 2023, 09:37

Welcome to this AutoHotkey forum!

Code: Select all

#Requires AutoHotkey v2.0
musicDir := StrReplace(A_Desktop, 'Desktop', 'Music')
Loop Files musicDir '\* - *', 'DR'                     ; Get the source directories
   RegExMatch(A_LoopFileName, '(.+?) - (.+)', &m)      ; Parse into directory and subdirectory
 , DirMove(A_LoopFilePath, musicDir '\' m[1] '\' m[2])
MsgBox 'Done!', 'Status', 64

Juan Gabriel Moya
Posts: 2
Joined: 24 Mar 2023, 21:24

Re: Help with Multi Folder Script

Post by Juan Gabriel Moya » 28 Mar 2023, 15:06

Thank You So Much.
I receive:
Error: Hotkey or hotstring is missing its opening brace.

Line: 4

User avatar
boiler
Posts: 16926
Joined: 21 Dec 2014, 02:44

Re: Help with Multi Folder Script

Post by boiler » 28 Mar 2023, 15:20

Did you run the script exactly as posted, or did you try adding a hotkey or something?

Post Reply

Return to “Ask for Help (v2)”