Name Folder From Clipboard

Hey, I have been searching the forum and wiki, but I can't really wrap my head around this.
For instance, this is the link I end up at when searching for "clipboard to variable":

What is wrong with this Macro?

Name Folder from Marker.kmmacros (3.8 KB)

It is hard to say since you don't clearly define the purpose of the macro, nor provide us with your expected outcome. Specifically, how are you trying to name the new folder?

Some things I did notice that could cause problems:

  1. The KM variable "Variable Name" is never defined.

  2. The path you use in the Create New Folder does NOT look like a valid path.

  3. You set the Clipboard using the Copy command here:
    but then you overwrite the Clipboard here

  4. I realize that KM often provides a variable name of "Variable Name", but, IMO, you should never name a variable that. Always replace "Variable Name" you your own name that indicates the contents of the variable.

Before you post your questions, please first read:
Tip: How Do I Get The Best Answer in the Shortest Time?

Thanks! Yeah, I’m still trying to wrap my head around the very basics of KM (and the forum!). Sorry about that.

I just want to create a folder (in the promted location) and name it from the Clipboard. (The text in the clipboard comes from a marker in Logic Pro X)

If I understand you correctly, it sounds like all you need to do is use the token for the clipboard's current contents in your last step:

Name Folder from Marker 1.1.kmmacros (3.5 KB)

Aha, thanks, will try! I thought I somehow had to "copy" the system clipboard to a variable, if that makes sense? I didn't know I could just use %SystemClipboard% Thanks!

1 Like

Yes, that certainly worked. Thanks!

1 Like

I'm glad that @gglick's solution worked for you. However, it did take a bit of guessing on his part.

That is why I asked you:

It now appears that the selection you are copying is what you want to use for the suffix to your new folder. So the new folder name would be:
BUMPER <SystemClipboard>

So if the selection is "A12345", then the new folder name would be "BUMPER

This is the type of information/requirements we need to best help you.

Some Observations/Changes

  1. I noticed that you have used a number of Pause Actions for 1.0 seconds. In most cases this is way too much time for the pause. I would always start with 0.1 or 0.2 seconds and then only increase if need be.
  2. The Pause after the Choose Folder action is not needed at all.
  3. I would almost always use the COPY Action rather than the Type ⌘C Keystroke action because the copy will wait until the clipboard changes.
  4. One other thing is that you need to make sure that the new folder suffix does NOT contain either any slashes or colons.

So here's my revised macro taking into account all of that:


MACRO:   Name Folder from Marker 1.2 @JMichaelTX

~~~ VER: 1.0    2019-06-23 ~~~


Name Folder from Marker 1.2 @JMichaelTX.kmmacros (11 KB)
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.




Thank you for the information regarding posting here! Downloading the macro now!