Trying To Duplicate a File Before Sending It To Yoink


I have a library of templates (blank Pages, Numbers, MS Word, MindNode, etc files). I created a palette of macros to send those templates to Yoink.

As I am working in other apps and projects, and need to insert a template, I simply trigger the palette β†’ choose the appropriate macro β†’ the file appears in Yoink and I drag and drop it into whatever project I am working in Scrivener, DevonThink, Bear etc

It all works fine, but there is one problem. If I send a template to Yoink and drag the file into another Finder folder, the file is deleted from its orginal location (which is how Yoink works).

Instead of sending the original file to Yoink, I would like to first create a duplicate β†’ send to Yoink β†’ delete duplicate if still present in original folder.

thanks in advance for your time and help

Yoink Word Template DUPLICATE FOR KM FORUM.kmmacros (30.3 KB)

If you use the same folder the duplicate will have to have a different name. But your Mac has a hidden-from-the-Finder special folder for temporary files -- /tmp and using that will avoid a name clash. So try starting your macro with:
...changing the "Open" action to suit:
...and finishing with:

(I don't have Pathfinder/Yoink so can't test, but I assume they have Full Disk Access and can access /tmp.)

1 Like

Sorry for the delay. A great solution which both helps me solve this problem and improve my KM skills. Thanks very much !

Your macro is excellent.

I had to make a few changes to implement it: and there is one residual problem.

  • because I have many similar template macros, I opted to start by creating a variable with the filename and using that variable in the path in all subsequent actions. That way, I only have to insert the filename once and never the path every time I create a new version of the macro (for different files like numbers, pages, scapple, etc)

  • the last delete command is an excellent idea but can't be used because as soon as the file is deleted from the tmp folder, so is its counterpart in Yoink.

  • the last glitch to iron out is that since I cannot delete the file at the end, the initial copy action does not work when the macro is used repeatedly with the error message "Action Failed because destination already exists."
    . This would be solved by a copy and replace action but I can't find such a thing when I search the forum which is surprising.. Would you have any idea ?

thanks again very much

Then don't use /tmp, as the whole point of that folder is that it's for temporary files which will get deleted by the OS!

You need to reword your requirements and possibly rethink your workflow. You could make the duplicate into a project-specific "destination" folder to avoid name clashes, then "send to Yoink" (whatever that means!) from there. Or keep all your templates in one place but create them with unique names, eg adding a date/time stamp on duplication.

But you might be better off using "proper" templates -- either those provided by programs (like Word's templates) or by creating your template file then locking it in Finder's "Get Info". Then your workflow would be open template -> edit template -> forced "Save As..." (because the template cannot be modified) to "destination" folder -> Yoink the new file.

1 Like

Thanks very much for the suggestions.

I had disabled the delete command for the reasons you state. We could not have guessed that the file would also be deleted from yoink.

To keep it simple, I was thinking about simply adding a date and time including seconds to the copy to filename.

So I would add the copy file action from
%TemplateFile% + %LongTime%

what would be the correct syntax for
%TemplateFile% + %LongTime%

subsequent deletion is I think no problem: I would have Hazel regularly clean up the tmp folder

thank you

No! If you are using \tmp -- the hidden tmp folder at the root level of your system disk -- the OS and other programs will manage that folder for you. Lots of processes place temporary files in there so it's best to only, and specifically, delete files that you have put in there.

I'm starting to think that you could do something like:

  • Prompt for the template(s) to duplicate
  • Prompt for a destination folder, or get that from "path to frontmost document" or similar
  • Duplicate the file to the appropriate place
  • Tell Yoink to do its thing

But, again, this is based on total ignorance about your overall workflow and about Yoink in particular (I'd assumed from it's name that it "yoinked" files around your directory structure for you, but it sounds more like it tracks their location).

1 Like

OK. thanks very much. I will rethink the whole thing. and the logic behind it.

Had a look at Yoink's web page and it appears to simply be a "place holder" -- drag stuff to it and it'll proxy the item ready to resume the operation later.

You're adding to the "shelf" with Pathfinder -- how are you taking stuff off the "shelf" and into your target apps?

1 Like

I then drag and drop into another app.
I solved the problem thanks to your help and starting by duplicating the original and using the copy.
The problem with Yoink is that in certain cases it leaves the original file in Finder intact and in other cases it deletes it.
I start the macro by looking for a copy and deleting it if it exists.
I continue by creating a copy and sending the copy to yoink. I don't use an intermediary temp folder.
It all works fine now.

Hi @ronald, I also work with such a KM Palette and Yoink.
Here is an example video for ScreenFlow 10:

The trick with Yoink is to hold down the βŒ₯ - Option key within the Finder when drag and drop from the Yoink window.
Then your template will be copied to the new Finder folder.

Here is an example video.

So you don't have to copy your template and delete it againπŸ˜‰

If you click on the video links, you will get the videos in the best resolution.

1 Like

@appleianer beat me to it -- Yoink's web page says you can Option-drag things from Yoink to create a copy in the destination rather than move the original.

What I don't understand is why you are sending these things to Yoink in the first place. It seems designed (@appleianer? You're a self-confessed user!) to be a place where you either keep resources permanently so they are available whenever you need them or as a staging post for full-screeners who can't see both source and destination at the same time.

You know where the source files are -- why not just use a KM action to copy them to the destination? If it's the same, multiple, files use multiple actions. If the files might vary, choose them from a multi-selection "Prompt with List" action. Many ways to skin this particular cat that'll stop you having bounce between multiple apps and use the GUI...

That's the most important bit! If you've got a working solution that you're happy with -- ignore the nonsense I've spouted above :wink:

1 Like

Hi @Nige_S, I use the Yoink workflow in ScreenFlow 10 because it's not possible there to simply insert media/images via copy & paste and always at the cursor. So where I need them
(like in the first example video). This is one of the main reasons to use Yoink.

Unfortunately, ScreenFlow doesn't allow my templates to be synchronized across multiple Macs, so I organize and synchronize the media/images using the Finder.

I also use Yoink to collect various files, media, links, texts in a stack for a project, in order to then insert them in one piece (DEVONthink Pro for me).
Also via the Yoink iOS app :wink:

It's a great solution and very simple. thanks very much !

1 Like

yes, but in that case, you still have to remember to delete the original in Yoink.

Yoink is much too small a window for that. Files are tiny icons that you can't differentiate without triggering quick look which is tedious. Prompt with list takes more time.

From you it's NEVER nonsense. I can't find the words to express how much I appreciate your help.