sim871 Posted January 6, 2019 Posted January 6, 2019 Hi All, Just found out about the app Alfred while searching automation options. I am hoping the community can shed some light on whether Alfred can help me or not and if yes, give me a steer in the right direction. What I would like to do is: 1-Rename an mp3 file, preserving its extension, using its parent, sub-directory name. 2-Move the file to the root directory and delete the original parent directory. For example, change this:Songs (Root directory) Good song (sub-directory) asdfgh.mp3 (file) Really good song (sub-directory) zxczvb.mp3 (file) To this:Songs (Root directory) Good song.mp3 (renamed & moved file) Really good song.mp3 (renamed & moved file) Many thanks, Sim871
vitor Posted January 6, 2019 Posted January 6, 2019 Welcome @sim871, Yes, that is quite possible, though not without coding. Also, you need to buy Alfred’s PowerPack. If you do so, I can make the workflow for you. It’ll work like this: You select the file. Press a keyword. A menu will appear. You pick the relevant action. Done.
sim871 Posted January 6, 2019 Author Posted January 6, 2019 Hi Vitor, Thanks for the speedy reply. I purchased the power pack. Grateful for any help! For clarity, I was hoping to point Alfred to the Songs (Root directory) and have it run the script/macro against all of the sub-folders in the the Songs (Root directory). Is this possible? Songs (Root directory) Good song (sub-directory) asdfgh.mp3 (file) Really good song (sub-directory) zxczvb.mp3 (file) To this:Songs (Root directory) Good song.mp3 (renamed & moved file) Really good song.mp3 (renamed & moved file)
vitor Posted January 7, 2019 Posted January 7, 2019 This should work. It only works on .mp3 files, but it does work recursively (it moves everything to the top directory). Do note as a warning that since its operations are destructive (it renames the file and deletes the directory) you should back up your data before running the Workflow, just in case. For example, if a directory has two .mp3 files, since both will be moved to the top directory with the same name, one of them would be lost. To run this, select your Songs directory (can be any name) and run the Rename Songs File Action.
sim871 Posted January 9, 2019 Author Posted January 9, 2019 Vitor, All I can say is MAGIC! And thank you. Works amazing. What language is the script written in? vitor 1
vitor Posted January 9, 2019 Posted January 9, 2019 17 hours ago, sim871 said: All I can say is MAGIC! And thank you. Works amazing. You’re welcome. I’m glad. 17 hours ago, sim871 said: What language is the script written in? Ruby, but any general purpose language would’ve worked.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now