How do I deselect after highlight and copy all?

Hi,
I want to add a date to the end of this action.

But when insert the date it is rewriting the entire draft because a prior step “selected all text” to copy it…

How can I add a step / script to deselect all… move the cursor to the end of the Draft?

I can add the date from there…
Many thanks.

For future reference, the best way to share a full action here is to post it to the Directory as unlisted and use that link. drafts:// links don’t really play nice on the web and that allows us to preview the content of the action and help without having to install it.


For you question…why does the action select all the text? I’m not clear I see any reason for it to to begin with, it does not do anything with the selection.

Secondarily, using “Insert Text” would not be a good way to add your text in this action. It is otherwise manipulating the current draft. “Insert Text” adds text to the editor. Often the current draft is the one loaded in the editor, but it is not always – e.g. if you were to run this action from Shortcuts, or via a URL scheme. You could just append in your last script, before the drafts.update() call, like:

draft.append("MY TEXT");

Sharing actions - notes.

Copying text - it does serve a purpose. It copies the selected text to my clipboard which I then paste elsewhere. In this case LinkedIn. There are no actions for LinkedIn posting.

Not sure if your suggestion remains the path to follow based on use case described?

The script step that selects the text in that action is not necessary. The “Clipboard” step has a template which controls what it puts in the clipboard, and it is set to [[draft]] (the entire text of the draft), and would put that content in the clipboard regardless of what is selected in the editor. This is the same way the default “Copy” action works, not requiring you to make any selections.

1 Like

Got it. So drop the select all script and I’ll have what I’m looking for. Excellent. Thanks!