gogoizzy Posted July 9, 2021 Posted July 9, 2021 (edited) 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 and this is how I do it with a single button using TouchPortal: How can I write/paste text from a flow in Alfred? Edited July 9, 2021 by gogoizzy grammar
GuiB Posted July 9, 2021 Posted July 9, 2021 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 GatorMapi 1
gogoizzy Posted July 12, 2021 Author Posted July 12, 2021 (edited) Thanks GuiB, So I have created this: The labels in Copy to Clipboard show what is written in there: 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 Edited July 12, 2021 by gogoizzy
GuiB Posted July 12, 2021 Posted July 12, 2021 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
gogoizzy Posted July 12, 2021 Author Posted July 12, 2021 Hi GuiB, that worked!! Thank you. I got it down to 0.5
GuiB Posted July 13, 2021 Posted July 13, 2021 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!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now