Jump to content

How to paste text in a workflow


Recommended Posts

Hi,

 

I am a new user that has come over from TouchPortal.  I am really hoping that Alfred can help and be better but I am stuck at my very first flow - how to write or paste text (or a snippet)?

I am a developer in Podio and I am often making buttons. These buttons are actually category fields that can be selected like buttons. I enter the name the field then press enter to make the next field i.e

Not Done

[enter]
Do It Now

[enter]

Done

[enter]

Error

[enter]

 

In a flow I can push the [enter] ok using a Key Combo brick but how can I paste/write the words.

 

I have attached a picture of what I need below

image.png.a05a977c83f00ab701d9c631580ae343.png

 

and this is how I do it with a single button using TouchPortal:

image.png.1e86ac0713ba1003994f9ef9aa649380.png

 

How can I write/paste text from a flow in Alfred?

Edited by gogoizzy
grammar
Link to comment

To paste text from a workflow you can use the "Copy to Clipboard" Ouput object, write the content that you want in the text field (where it's written "{query}" by default) and check the "Automatically paste to front most app" toggle. You can also check the "Mark item as transient in clipboard" if you want that Alfred clear this content from the clipboard

Link to comment

Thanks GuiB,

 

So I have created this:

image.png.4722cf84c56679cf7877ade8baa88e87.png

 

The labels in Copy to Clipboard show what is written in there:

 

image.png.e59a7e6b45f87514dc8294fce6fdceac.png

 

The key combo is the Enter key.

 

Here is the result:

Quote


 

 

 

ErrorErrorErrorError

 

 

It runs 4 carriage returns and then seems to be only running the last flow brick 4 times? (note: I changed the last brick to a different word and it repeated that word 4 times too.) It does not seem to interpreting the flow in the order written?

 

Quote

 

[07:48:17.892] Logging Started...

[07:48:48.040] Trigger Categories[Snippet] Processing complete

[07:48:48.056] Trigger Categories[Snippet] Passing output '' to Copy to Clipboard

[07:48:48.060] Trigger Categories[Copy to Clipboard] Processing complete

[07:48:48.061] Trigger Categories[Copy to Clipboard] Passing output '' to Dispatch Key Combo

[07:48:48.062] Trigger Categories[Dispatch Key Combo] Processing complete

[07:48:48.064] Trigger Categories[Dispatch Key Combo] Passing output '' to Copy to Clipboard

[07:48:48.064] Trigger Categories[Copy to Clipboard] Processing complete

[07:48:48.065] Trigger Categories[Copy to Clipboard] Passing output '' to Dispatch Key Combo

[07:48:48.066] Trigger Categories[Dispatch Key Combo] Processing complete

[07:48:48.067] Trigger Categories[Dispatch Key Combo] Passing output '' to Copy to Clipboard

[07:48:48.068] Trigger Categories[Copy to Clipboard] Processing complete

[07:48:48.069] Trigger Categories[Copy to Clipboard] Passing output '' to Dispatch Key Combo

[07:48:48.070] Trigger Categories[Dispatch Key Combo] Processing complete

[07:48:48.071] Trigger Categories[Dispatch Key Combo] Passing output '' to Copy to Clipboard

[07:48:48.072] Trigger Categories[Copy to Clipboard] Processing complete

[07:48:48.073] Trigger Categories[Copy to Clipboard] Passing output '' to Dispatch Key Combo

 

 

 

 

 

I need it to assimilated what I type on the keyboard i.e

 

Not Done [Enter]

Do It Now [Enter]

Done [Enter]

Error [Enter]

 

So the final outcome 

 

Not Done

Do It Now

Done

Error

 

image.png

Edited by gogoizzy
Link to comment

You will need to insert "delay" after the clipboard objects so the system have the time to copy the text to the clipboard and then output it before going into the next object. Beside that, if you don't want to delay and since those are short strings, you may be better to output keystrokes using AppleScript. Depending on your content, pasting is faster than keystrokes, but since you need to wait some time to copy the content then for short strings the keystrokes may be faster to do the process.

 

So, here is a workflow as example to show you both methods and I have added a "clipDelay" variable so you can try and see if you can reduce the delay time depending on your system and content.

 

Here is the workflow: https://d.pr/f/gnSzAS

Link to comment
21 hours ago, gogoizzy said:

Hi GuiB, that worked!! Thank you. I got it down to 0.5

Great that it worked! However, for the delay I find 0.5 to be quite slow (I can set mine down to 0.11 before seeing bad outputs), is it the delay time after each "Copy to Clipboard" item or you mean the whole workflow takes 0.5 to do everything? Maybe the application you are outputting to is slow... If it takes 0.5 second between each Copy to Clipboard, then I would see if the AppleScript using keystrokes method is faster without errors (see second snippet in my workflow: \\wftc2 ).

 

And actually, based on your first screenshot, I would guess that TouchPortal use "keystroke" to "write" the text content. So, you can try my other method from my above workflow and see if it's faster. Or if you are happy as it is, then have fun automating your work! :)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...