Jump to content

Simulate Typing (or Pasting text without copying to clipboard)

Recommended Posts

I have a script where I'd like to enter some text after opening up a search window. How can I have it enter a specific line of text without copy/pasting? 

Worfklow is like this:
Open chrome

Type command f

Enter a specific line of text (Joe Smith).


How can I do this? Should I setup a snippet and then have that snippet triggered somehow at a specific moment in the script? Thanks!

Share this post

Link to post

Snippets actually use the clipboard. Alfred just restores the old clipboard content after the snippet has been expanded.


What is your objection to using the clipboard?

Share this post

Link to post

I see. Well, if you use copy/paste it clears what's in the copy/paste buffer which was actually the point of the workflow (sorry I didn't specify clearly before). 

I'm trying to automate several things for different apps based on the same workflow where I'm constantly emailing or sending links to my business partner in gmail, hangouts, slack, etc. 


To send something in Slack, it would be like this:

  1. Copy something from the web. 
  2. Launch slack desktop.
  3. Command - K
  4. Automatically type the name of the person I wish to find
  5. Enter
  6. Command - V to paste the thing I wanted to send them

I believe Keyboard Maestro has this ability to enter text without copy paste, so maybe I can make a shortcut to trigger an action using keyboard maestro for the 'typing' but it's a shame to have to use two apps. 

Thanks in advance.


Share this post

Link to post

So you just don't want the data to stay on the clipboard?


You can simulate typing text with AppleScript: tell application "System Events" to keystroke "your text goes here"

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.

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