Jump to content
liatmgat

Help making a workflow to paste text into new TextEdit doc

Recommended Posts

Hello,

 

I need help learning how to make the following simple workflow. I would like it to do this:

 

Paste selected text without style into a new TextEdit document.

 

I have made workflows before but only for opening files, apps, and URLs - never anything more complex than that. I don't know how to do Apple Scripts and such. Just so you know to dumb it down a little for me. :)

 

Thank you so much!

Share this post


Link to post

Hello,

 

I need help learning how to make the following simple workflow. I would like it to do this:

 

Paste selected text without style into a new TextEdit document.

 

I have made workflows before but only for opening files, apps, and URLs - never anything more complex than that. I don't know how to do Apple Scripts and such. Just so you know to dumb it down a little for me. :)

 

Thank you so much!

 

The easiest way to do this is to create a new workflow, with a hotkey trigger. With the hotkey trigger, set the hotkey and set the argument property to be "Selection is OS X". Save that and move on. Next, add a Run Script action. Set the language to osascript, uncheck the escaping options. You probably wouldn't need them. Then in the code area enter..

tell application "TextEdit"
    activate
    make new document with properties {text:"{query}"}
end tell

Connect the hotkey and the action, and test it out.

Share this post


Link to post

The easiest way to do this is to create a new workflow, with a hotkey trigger. With the hotkey trigger, set the hotkey and set the argument property to be "Selection is OS X". Save that and move on. Next, add a Run Script action. Set the language to osascript, uncheck the escaping options. You probably wouldn't need them. Then in the code area enter..

tell application "TextEdit"
    activate
    make new document with properties {text:"{query}"}
end tell

Connect the hotkey and the action, and test it out.

 

Hi David,

Thank you so much for helping me.

I did what you said but it doesn't seem to be working. Maybe I should clarify what I'm hoping to do.

 

I want to select text anywhere, like in Safari or Pages or anywhere, and then have the hotkey open a new TextEdit document and paste the selected text into the new document using Paste and Match Style.

 

When I did what you said, nothing happened.

Here is what I have:

 

Screen-Shot-2014-08-15-at-11.07.51-AM.pn

 

Screen-Shot-2014-08-15-at-11.07.58-AM.pn

 

Screen-Shot-2014-08-15-at-11.08.07-AM.pn

Share this post


Link to post

Hi David,

Thank you so much for helping me.

I did what you said but it doesn't seem to be working. Maybe I should clarify what I'm hoping to do.

 

I want to select text anywhere, like in Safari or Pages or anywhere, and then have the hotkey open a new TextEdit document and paste the selected text into the new document using Paste and Match Style.

 

When I did what you said, nothing happened.

Here is what I have:

 

Screen-Shot-2014-08-15-at-11.07.51-AM.pn

 

Screen-Shot-2014-08-15-at-11.07.58-AM.pn

 

Screen-Shot-2014-08-15-at-11.08.07-AM.pn

 

Actually, in the escaping, tick the option to escape double quotes. Was the text you tested this with.. did it have any double quotes in it? This works just as you described in my testing.

Share this post


Link to post

Thank you so much! It worked!

 

My only last question is: is there a way to paste as Paste and Match Style (shift-opt-cmd-v) instead of just regular Paste? That is my goal for this workflow.

I really appreciate your help!

Share this post


Link to post

Actually, in the escaping, tick the option to escape double quotes. Was the text you tested this with.. did it have any double quotes in it? This works just as you described in my testing.

Thank you so much! It worked!

 

My only last question is: is there a way to paste as Paste and Match Style (shift-opt-cmd-v) instead of just regular Paste? That is my goal for this workflow.

I really appreciate your help!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...