Jump to content

Adding Mac OS X selection to a text file.


Recommended Posts

Posted

Hi, 

 

I am trying to create a workflow that would append some text content I select on Google Chrome. 

 

Here are the steps:

 

I select some content on a website (no copy to the clipboard, just a selection)

I hit a keyboard shortcut 

Alfred runs a command that would add the selected text in a specific file.

 

I created a workflow with a "hotkey" and a "run script" actions. 

 

Screenshot_2017-10-10_14_53.3.png.cae1b757c80607667b5cc7449ab65435.png

 

Screenshot_2017-10-10_14_53_24.png.ca5e35ffab03e04eddb1e0459311df7f.png

 

 

It is not working the way I want as every time I use workflow it appends the selection and the command (.i.e: "echo "{query}" >> ~User/Downloads/test.txttextselectedongooglechrome")

 

Screenshot_2017-10-10_14_55_36.png.aff388c08a34dd373baa798375146125.png

 

I guess I have missed something in the  "run script" action as I do not really understand the difference between "input as argv" and "input as query".

 

Thank you.

Posted

This is not the right forum: this post belongs in the "Workflow Help & Questions" forum.

 

Furthermore, you haven't followed the instructions on reporting problems. Specifically:

 

Quote

If you're having a problem with a workflow you're writing, post the actual, non-working workflow. Upload it somewhere (Dropbox?) and post a link.

 

Screenshots and code snippets are not enough.

 

You wouldn't expect your mechanic to diagnose your engine trouble from a couple of photos of your car, so why do you expect us to do that for your workflow?

 

Unless you've done something really obviously dumb, we can't help you.

 

Posted

@deanishe You are absolutely right. When I saw "Discussion and help" I thought there can't be a forum for help only for workflows. I clicked to fast. My bad.

 

@vitor Thank you. This is exactly what I wanted to build. I didn't know the "append to file" action existed. I tried to modify my workflow to make it exactly look like yours. For weird reasons, I had ""echo "{query}" >> ~User/Downloads/test.txt" being appended every time I hit the keyboard shortcut. Like if it was cached somewhere in the workflow. I recreated the workflow from scratch and now everything is working as I want to. :)

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...