Jump to content
CarlosNZ

Creating snippets from clipboard history

Recommended Posts

It seems awfully clunky to create a new text snippet. Alfred makes a lot of stuff so much quicker, so to have to stop, go to the preferences and manually enter a new piece of text for a saved snippet feels like a drag. I wonder if there couldn't be an easier way of creating snippets on the fly. The simplest way would be to allow you to perform an action on one of your clipboard history entries, to "store as snippet". Or, just a command in Alfred: "snippet <new text clipping>".

 

Heck, this would be a perfect thing for a user-created workflow. I'd do it myself, but that "snippets.alfdb" file is a bit to impenetrable for me (and, I'm assuming, not designed to be messed with externally).

Share this post


Link to post
Share on other sites

This is likely to come at some point soon (though perhaps not before the first v2 release)

 

In the meantime, as you suspected, it's preferable not to mess with the snippets database to ensure its integrity when Alfred needs to use it. :)

Share this post


Link to post
Share on other sites

[Moderator: Merged another thread with this existing feature request for easily saved snippets.]

 

It would be great to be able to set a clipboard entry as a memory item and then use a simple key stroke to paste from that particular memory area. I have looked in the documentation for Alfred and do not see any feature like that.

Share this post


Link to post
Share on other sites

I agree. It is VERY clunky to create a new snippet. Would be nice if this were more easy to do; some command line from Alfred, rather than having to drill down through Alfred's settings.

Share this post


Link to post
Share on other sites

I whole heartedly agree with this post. It is a pain to create a new snippet. And I love snippets. I've even thought about scripting the GUI via a sequence of key strokes (ultimate kludge).

 

Also fully support the following:

It would be great to be able to set a clipboard entry as a memory item and then use a simple key stroke to paste from that particular memory area. I have looked in the documentation for Alfred and do not see any feature like that.

 

I was just thinking about this the other night. It would be awesome to have a set of registers that you can paste text into. I would love this owe so much. For an example of another program that has a similar feature, see vim's named register functionality (http://vimdoc.sourceforge.net/htmldoc/change.html#quote_alpha)

 

Could be a keyword:

y 1

Yanks the text currently in the clipboard to register 1 (or A or B, etc.)

Or perhaps a sequence of keys. 

Edited by Exit42

Share this post


Link to post
Share on other sites

I liked this idea so much, I created the workflow. It works like this:

 

new-snippet-2.png

 

You just enter the workflow keyword, the snippet name, snippet keyword, and then paste in the content. The name and keyword need to be separated from the content by a colon, but you can use a colon in the snippet content.

http://www.alfredforum.com/topic/3119-create-new-snippet/

 

This workflow creates snippets in the snippets table just like Alfred does (uses the same timestamp format) as far as I can tell, and everything is working as expected. If you have any qualms, go ahead and backup your snippets.alfdb file first. 

 

Milo

Edited by Milo42

Share this post


Link to post
Share on other sites

Where is the snippets.alfdb? Can't find it.

 

By default, it is at: ~/Library/Application Support/Alfred 2/Alfred.alfredpreferences/clipboard/snippets.alfdb

 

However, if you've changed the location of your Alfred preferences, it might be somewhere else. To find it, run the following command in Terminal.app:

 

find ~ -name 'snippets.alfdb'

Edited by Milo42

Share this post


Link to post
Share on other sites

I came here just exactly just to suggest this. It's clunky that creating snippets disrupts the easy-and-fast-to-use workflow that Alfred is known for.

 

Using this Workflow, although I'd love to, may cause troubles, perhaps later than sooner, but as Vero said, this may happen.

 

Well, it's been almost a year since she said that. Any news on that?

Share this post


Link to post
Share on other sites

Any news on this?

 

Adding new snippets is really a pain in the neck, esp. because I have to find and select "Clipboard" while I'm looking for "Snippet" in the "Features" Tab. I would love to see a snippet add command that (at least) shows us the Alfred settings window where we can add a new snippet.

 

I also have some fear of using the workflow that might potentially hurt my db.

 

This is really bugging me, as I have begun moving my snippets over to Alfred - and as a power user I'd love to see some improvement on the snippets side.

 

Cheers!
Michael

Share this post


Link to post
Share on other sites

+1 - A counter-productive implementation of a productivity feature. For now I've just made my clipboard history last much longer and I copy the snippet once and then type it in clipboard history to access it later. Still clunky.

 

Any news about this as a feature?

Share this post


Link to post
Share on other sites

I've wanted a better interface for Snippets since Alfred 2's beta releases.

Snippets is the only feature of Alfred that I don't use as much as I'd like. For example, I keep frequently-used special characters in my snippets so I can quickly insert them with a keyword. When I use a character that isn't in my database, I want to save it right away. I never actually do, because to open Alfred's preferences, navigate to snippets, and add an entry breaks my workflow. The same is true when I want to save a code snippet.

A native interface for snippet manipulation would be a very welcome addition :)

Share this post


Link to post
Share on other sites

Snippets will definitely get an overhaul in the future, I'm aware that it feels a bit clunky at the moment. Not quite yet though as there are many great Alfred things in development which are taking priority :)

Share this post


Link to post
Share on other sites
Hi
I am considering buying you powerpack to get the clipboard and snippets functionalities, but am undecided whether I thus will be able to replace adequately my Typinator and Jumpcut applications with Alfred. So I would like to express my +1 to the work on Snippets/Clipboard features and ask a couple of questions regarding the direction of development of built in features:
  • Have you considered allowing the Clipboard Snippets window its own hotkey (in addition to the keyword)?
  • Will you be able to add snippets from the clipboard overview or, even better, directly from selected text?
  • In connection to the latter, will Alfred be extended to be able to handle selected text/files, thus making it rival Launchbar's Send to features? Performing actions based on selected text (rather than having to type it in the alfred window) would be immensely useful to me. I have read the request about OS X Services integration but i was hoping for a built in functionality.

I hope you will give me a hint of the timeframe for development in this area and whether it might take any of these directions.

 

WBR
Chris

Share this post


Link to post
Share on other sites
  • Have you considered allowing the Clipboard Snippets window its own hotkey (in addition to the keyword)?
  • Will you be able to add snippets from the clipboard overview or, even better, directly from selected text?
  • In connection to the latter, will Alfred be extended to be able to handle selected text/files, thus making it rival Launchbar's Send to features? Performing actions based on selected text (rather than having to type it in the alfred window) would be immensely useful to me. I have read the request about OS X Services integration but i was hoping for a built in functionality.

 

Any existing functionality mentioned here requires you to have a Powerpack license:

  • The clipboard snippet feature does have its own hotkey. By default, it's Option + Command + C, which searches only Clipboard Snippets and History
  • I'd venture to guess that, in the future, adding snippets will be very accessible, including the clipboard history contents and selected text options. Andrew doesn't ignore user feedback :)
  • Using hotkeys, you can perform actions on both selected text and files. Not sure about OS X Services integration, but that would be a cool functionality; perhaps a workflow will eventually crop up allowing this kind of integration
Edited by Tyler Eich

Share this post


Link to post
Share on other sites

 

Any existing functionality mentioned here requires you to have a Powerpack license:

  • The clipboard snippet feature does have its own hotkey. By default, it's Option + Command + C, which searches only Clipboard Snippets and History
  • I'd venture to guess that, in the future, adding snippets will be very accessible, including the clipboard history contents and selected text options. Andrew doesn't ignore user feedback :)
  • Using hotkeys, you can perform actions on both selected text and files. Not sure about OS X Services integration, but that would be a cool functionality; perhaps a workflow will eventually crop up allowing this kind of integration

 

Hi

Thanks for your response. I wen't ahead and got the powerpack, and I am in no way disappointed.

In regards to the hotkey issue, I was suggesting that the snippets view should get their own hotkey, maybe just a default clipboard hotkey + ctrl.

The present features are very workable for me but I am hoping to see further development in this direction, especially in regards to adding snippets more fluently.

Now I am considering upgrading my license to über supporter.

Share this post


Link to post
Share on other sites

Stonefury: Milo42's workflow (mentioned above) works well for me; allows me to create snippets without having to mine down into the preferences.

 

 

new-snippet-2.png

 

You just enter the workflow keyword, the snippet name, snippet keyword, and then paste in the content. The name and keyword need to be separated from the content by a colon, but you can use a colon in the snippet content.

http://www.alfredfor...te-new-snippet/

 

This workflow creates snippets in the snippets table just like Alfred does (uses the same timestamp format) as far as I can tell, and everything is working as expected. If you have any qualms, go ahead and backup your snippets.alfdb file first. 

 

Share this post


Link to post
Share on other sites

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