Rename iPhone VoiceMemos files

Hi All -

I’m trying to manage my voice memos recorded on my iPhone and create a workflow to get them into a specific folder in the finder. I’m using Hazel to do some heavy lifting, but I’m stuck at trying to get the iTunes Track Name into the File Name in the Finder.

So, I record a voice memo on the phone and when I get home at night my phone syncs to iTunes. I’ve created an iTunes Smart Playlist to gather all my voice memos and that works fine. Note that the iTunes tracks are properly named to whatever label I used in the iOS Voice Memos app. Now, I know the corresponding files are stored in:

~/Music/iTunes/iTunes Media/Voice Memos/

There, though, the files are named with the typical “DATE TIME.ext” format. What I’d like to do is have the files in that folder named as the iTunes tracks, but I’ve failed at coming up with a way to do this.

Either Applescript or a Shell script would work, but (preferably) I’d like it to run “outside of iTunes”. I can’t find the files themselves contain any EXIF or MP3-Tag data containing the Label.

Any ideas?

Many thanks in advanced.

Rick.

I’ve been trying with no luck…

No one here with a hint?

TIA.

Hey Rick,

Select one of the files you’re working with in the Finder and run this:


tell application "Finder" to set finderSelectionList to selection as alias list
if length of finderSelectionList = 0 then error "No files were selected in the Finder!"
set theItem to POSIX path of (item 1 of finderSelectionList)

set shCMD to "mdls " & quoted form of theItem & " \\
| open -f"
do shell script shCMD

It will create a meta-data report on the file and open it in TextEdit.

If you see the track info you’re looking for then look at “man mdls” in the Terminal. You can get single meta-data items like so:


set shCMD to "mdls -name kMDItemDisplayName " & quoted form of theItem
do shell script shCMD


Chris


{ MacBookPro6,1 · 2.66 GHz Intel Core i7 · 8GB RAM · OSX 10.11.6 }
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Thanks for the tip, Chris!

I had, however, already looked into the file’s metadata using another application (not mdls) but didn’t find the iTunes “Song Name”.

I did use your script regardless to look into a freshly created (and labeled) file in iOS, but there’s nothing there. No metadata with my label anywhere. The iOS label does show up in iTunes though, as expected.

I’m able to run an iTunes script from Doug Adams collection to rename the Finder file, but within iTunes mind you.

( Doug’s script: http://dougscripts.com/itunes/scripts/ss.php?sp=filerenamer )

I might just have to find a way to loop that script into Hazel and call it when the phone syncs… Yikes!

Any further insight or ideas are well appreciated.

TIA.