Question Mark Added to the Newly Created Folder

Hey Guys,

New user here and loving the possibilities of this application.

I am trying to create my first macro to create a set of folders for my new projects. I think I am on the right direction but I keep getting a question mark added to the beginning of the newly created folder.

Any help is appreciated, please see the attached image for the macro:

Hi @abhi_Kala - welcome!

A search of this forum turned up another thread like this and - oddly - one I contributed to. Here is what the OP said:

In other words there was an out-of-place character in the name of the item they were creating.

Without having access to your actual macro it is hard to tell, but is there a line break where you set your variable projpath?

If that’s not it please upload your macro so we can study it properly?

You might also like this:

1 Like

Thanks, tiffle.

You are absolutely right, there was a line break.

Thanks for the help, all resolved.

1 Like

I had this question mark issue before, and I was scratching my head when I saw it.

@peternlewis, is it possible to trim the line break in the file names in the relevant actions?

Excellent suggestion. This is how the Finder works, that that would make KM more consistent and intuitive.

1 Like

In general it would make sense for Keyboard Maestro to actively trim white space from paths before using them - when would you ever want a file name that ends with white space?

Except some people do use file names that start with spaces to force sorting or indentation. But maybe just at the end.

The problem then becomes what happens when you actually want to reference a file that has white space at the end of it? What about if you are scanning through a list of files on disk for example, and they happen to have spaces at the end of them.

Nothing is ever quite as simple or straight forward as we might like.

1 Like

How about trim only the line breaks?
Replacing the line break with a question mark is an odd behavior to me. I had no clue when the question mark came from the first time I saw it.
Or you can trim by default and offer the not trimming as an option in the action setting, so that users are conscious about what they are doing when they choose not to trim. I guess in most cases, users do not want to begin or end a file name with either a line break or spaces.

1 Like

Exactly. That is how the Finder works.