Want to create a folder with a name from user prompt

was trying to create a folder with a name derived from user prompt. trying new folder action with user prompt and also set to variable action. nothing seems to be working… any help appreciated.

The New Folder action will only work when there are no intermediate folders to be created, that is you can only create a new folder in a folder that already exists.

This should work:

Create New Folder.kmmacros (2.3 KB)

Rather than “nothing seems to be working”, it is better to post your best effort macro so people can see what you have done and make suggestions. @Tom is just guessing at one possible issue (trying to make multiple levels of directories at the same time), but we have no idea if that is the issue, or there is something else going on with what you are trying to do or how you are trying to do it.

So make some sort of macro, and then see what it does, and report that and the difference between that and what you want. Also, the Engine.log file may report errors that may help.

1 Like

"nothing seems to be working" is not indicative of capabilities of KBM but my inability to make this particular macro to work.:smiley:

here is the macro enclosed.

in the user prompt i am adding the name of the folder to be created.

in the macro as a last action instead of make new folder action if i use action 'display message', folder name and path are displayed correctly.

but when i use it with create new folder action , i get an error message.create folder as project.kmmacros (2.1 KB)

It’s %Variable%folder name% (not %variable%folder name%).

See also KM Wiki: Variables.

1 Like

Thank you Tom.

I tried. But not working.

regards

Anil

It works, but only if the intermediate folders are already existing. If you have to create more folders than the last path component then you have to use the Shell script action as shown above (instead of the Create New Folder action).

Have you tried my macro from above? Doesn’t this work either?

1 Like

No Tom. I didn’t try.

I am a novice at KBM and programming. Trying it make it work with KBM.

Well, that’s why I posted the macro for you :wink:

1 Like

“It works, but only if the intermediate folders are already existing”.

Tom i didn’t understand the statement. I have all intermediate folders existing till “project Execution folder”

The new folder i want to create is supposed be in “project execution”

If your folders are only existing until project Execution folder you cannot create a new folder in project execution with the Create New Folder action. With the Create New Folder action you can only create a new folder directly in project Execution folder.

But it does work with the Shell Script action from the macro above.

Let me know if my macro from above works for you.

To install it, download it, then double-click it in the Downloads folder. Then in KM Editor assign a hotkey and try.

1 Like

Thank you Tom. Script is working fine . I just tried.

Sorry . I meant to say Project execution folder also exists. I am trying to create my new folder in project execution folder.

create folder as project.kmmacros (1.4 KB)

Hi Tom,

Just tried an automator work flow and added with KBM macro with a hot key. working as i wanted.

thank you for your assistance.

rgds

Anil

Great that you have found a solution :slight_smile:

1 Like

I’ve just seen that in your macro you have set ⌘F as hotkey. This is probably not a good idea because ⌘F is used for ‘Find’ in almost every program, the Finder included.

Since your macro is enabled in all applications you are effectively blocking the Find command of every program.

If you need the macro only in the Finder, you should configure the macro group accordingly. See KM Wiki.

1 Like

Thank you Tom. That’s a very good input. i shall change the trigger.

best regards
Anil