I'm having trouble getting this CD-importing macro to work

I have a macro that checks for a CD to be inserted, prompts the user for the name of the audio file on the CD, then copies the audio file on the CD to an external drive and Dropbox if the user chooses so.

It's worked fine but after changing some variable names I get this error whenever trying to import the file. I can't read the entire error message (thanks Apple haha).

I've checked over the macro and can't find what is different now and causing it to not work, any help would be appreciated.

CD Importer.kmmacros (6.7 KB)

Hey There,

Go to the Help menu of the Keyboard Maestro Editor and select “Open Logs Folder”.

Open the Engine.log, and look for your error.

If you solve the problem great. If not then report back and we’ll help some more.

-Chris

I looked at the full error message and it wasn’t helpful for me although I know the stage the error is occurring at:

2017-12-21 16:02:12 File action failed because destination already exists /Volumes/External Disk/Message Recordings/.aiff In macro “CD Importer” (while executing Copy File “/Volumes/Audio CD/1 Audio Track.aiff”).

That appears to show you're trying to copy to .aiff, so it looks like your file-name variable contains a blank.

When troubleshooting paths, strip things down to the minimum.

Don't do any file actions.

Produce your full path string(s) using whatever your full process is.

Validate it/them.

A basic example:

Does an Item at a certain POSIX Path Exist?.kmmacros (3.6 KB)

If I had more than one path string I'd put them all in the Display Text action, so I could copy them out into BBEdit and test with them.

I've added an Execute a Shell Script action that actually validates the existence of an item at the single given path.

Paths are finicky. When you assemble them from variables you can create unintended mischief, so make sure they're perfect before you start trying to use them in actions.

-Chris

1 Like

Thanks for the help Chris.

After some troubleshooting I discovered my problem. The title for the input in a user-input window must match the variable name as well.