Jump to content
Carlos-Sz

[Workflow] Create a new text file with clipboard content

Recommended Posts

Here is a simple workflow to create a text file with clipboard content in the current or top most Finder window/folder:

 

1. using a hotkey: the text is created with the following filename pattern: Clipboard - yyymmdd(hhmmss).txt

2. you can use newf key in Alfred (see screenshot) so you can write the first part of the file name (use CTRL key to remove the date and time from the filename).

 

The default date and time was code this way in order to always generate an unique filename.

 

Screenshot:

 

http://d.pr/i/A2Kv

 

texthere.png

 

 

Download:

 

http://d.pr/f/5Jp7

 

 

This workflow is more a sample on how to use Shell/Bash and AppleScript together.

 

Credits to phyllisstein and his workflow* and David Ferguson for helping.

 

* http://www.alfredforum.com/topic/394-fixed-create-a-new-file-in-the-finder/

Share this post


Link to post
That's awesome! Should be very handy; great job.

 

Thank you.

 

Great stuff. Works really well. Make sure you upload it to the Alfred Repository so we can get auto-updates and the like.

 

Very interesting! Done.

 

One tiny suggestion — make the keyword argument "optional", and just give the file a generic name if the user doesn't specify one.

 

That’s a good idea. I’ll see if I can code it.

Share this post


Link to post

Great workflow!

 

Do you think it would be hard to autodetect whether the clipboard content is an image or a text to save it accordingly?  

Share this post


Link to post

Great workflow!

 

Do you think it would be hard to autodetect whether the clipboard content is an image or a text to save it accordingly?  

 

Regarding text this workflow is better and you can also save in current Finder window.

 

When you say image what exactly you mean? A peace of it from an image editor? 

Share this post


Link to post

Thanks for the updated link,

 

I meant, I'd love to be able to quickly save an image that I have in the clipboard (typically, I just did a screenshot to the clipboard, and I now have to create a file for some reason)

Share this post


Link to post

Thanks for the updated link,

 

I meant, I'd love to be able to quickly save an image that I have in the clipboard (typically, I just did a screenshot to the clipboard, and I now have to create a file for some reason)

 

FYI: In OSX you can use Command+Shift+4 to take a custom screenshot* and get a file saved in the Desktop automatically.

 

*Hit space bar then mouse click a window to take its screenshot

Share this post


Link to post

Yes, I know this (I actually use the Alfred2 screenshot workflow), the thing is: sometimes I took a clipboard screenshot, and I realize I have to send it to someone, so I have to open an image app & paste it, whereas as "Save clipboard as file" workflow would make it a snap (although I reckon this is something of a rarified occurence :)

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