Paste Multiple Clipboard using Ditto

Hey there. I'm trying to find a way to paste multiple texts that I copied to my clipboard in the same snippet. I use a clipboard manager called Ditto and it allows me to copy multiple things and paste them using a shortcut (for example, Ctrl + Alt + 0, Ctrl + Alt + 9, etc).

What I am trying to accomplish is to create a snippet that will send an e-mail filling out an order number, the customer's e-mail address, and the shipping address, which are all copied separately.

For example:

Please fulfill order ORDER_NUMBER by EMAIL shipped to ADDRESS.

My clipboard manager would show something like this:
image

And the shortcuts to paste them is currently configured to this:
image

I tried using the Key Press option but it doesn't paste anything.

Please fulfill order {key: ctrl-alt-8} by {key: ctrl-alt-9} shipped to {key: ctrl-alt-0}.

If I manually press Ctrl + Alt + 8, it pastes the correct text.

Any ideas on how I can make this work? :pray:

1 Like

Did you see our monthly update today about the {site} command working across multiple tabs. Would that work for you instead of copying and pasting multiple items?

https://community.blaze.today/t/november-developer-update/33146/3

1 Like

This actually worked perfectly. Even better than what I was looking to do! Thanks a lot! Time to update multiple snippets! :smiley:

Following up on this, I have a further question that perhaps you can help.

We get orders from both Shopify and WooCommerce. Is there a way to add a function that detects which window I have open?

For example, I created 2 snippets for the e-mail address. One for the Shopify orders and another for the WooCommerce orders.

The Shopify one is $shopifyemail and reads:

{site: text; page=https://admin.shopify.com/*; select=ifneeded; selector=p .Polaris-Button__Content_xd1mk}

The WooCommerce one is $wcemail and reads:

{site: text; page=https://secure.goodnesslover.com/*; select=ifneeded; selector=:nth-child(2) > .address > :nth-child(2) > a}

Is there a way to have it so that it will use one or the other in the snippet, similar to the example below?

Update shipping address for order by {import: $shopifyemail} or {import: $wcemail}

Would this be at all possible? If so, what's the best way of going around it?

In case it helps, WooCommerce order numbers are always above 20000 while Shopify order numbers are under 10000. Perhaps we can make a rule depending on the order number?

You could probably do this by checking if one of the selectors returns an error.

E.g. something like this might work:

Address: {={site: woocomerce command...} if not isError({site: woocomerce command...}) else {site: shopify command...}}

Does that help?

You are a freaking genius! That worked like a charm. It's just a shame it doesn't pop-up the selection window if I have both a Shopify and a WooCommerce order open, but I can live with that. :slight_smile:

Thank you for your help!

Hey @Support_Goodness_Lov ! Welcome back to the forum :slightly_smiling_face:

The selection popup does not show because each domain has only one corresponding tab to select. There is no need to make a selection for Shopify, as it has only one matching tab (and the same for WooCommerce).

If you want to always show the selection popup, you can set the select property to yes in the site command:

  1. Click on select here:

image

  1. Set it to yes in the right sidebar:

image

Note: It will still show both of the results in the selection popup (it will not actually allow you to choose the tab). If you want to choose a particular tab, you should use a formtoggle or a formmenu inside the snippet.


By the way @scott's suggestion works, and you can also simplify it to:

Address: {=catch({site: woocomerce command...}, {site: shopify command...})}

catch() will output the first successful command.

Thank you for the input and the simplified version. I have updated my snippets accordingly. :blush:

What I mean about the Shopify/WooCommerce selections is that, like many of us, I sometimes have dozens of tabs open at once.

If I have both a Shopify and a WooCommerce tab open, it will automatically select the WooCommerce order information.

Is it at all possible to have the pop-up if both a Shopify and a WooCommerce tab are open at the same time?

Right now, there is no way to conditionally open the popup: either it always opens, or it does not open at all.

In your case, you can have it always opens the popup, and then choose manually which source website to use:

Get both the data:
{woocommerce={site: text; page=https://secure.goodnesslover.com/*; select=ifneeded; selector=:nth-child(2) > .address > :nth-child(2) > a}}
{shopify={site: text; page=https://admin.shopify.com/*; select=ifneeded; selector=p .Polaris-Button__Content_xd1mk}}
Choose data to use: {formmenu: default=woocommerce; shopify; name=choice}
{if: choice="shopify"}{address=shopify}{else}{address=woocommerce}{endif}
Address: {=address}

See also: Autopaste & {if} - #2 by scott

Thank you very much. I will leave it as is for now. If a way of having the conditional pop-up is created in the future, I will look into it.

Have a great day!

1 Like