Jump to content

Creating snippets from clipboard history


CarlosNZ

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

Link to comment
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. :)

Link to comment
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.

Link to comment
Share on other sites

  • 6 months later...
  • 2 weeks later...

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
Link to comment
Share on other sites

  • 3 weeks later...

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
Link to comment
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
Link to comment
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?

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

  • 3 months later...

+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?

Link to comment
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 :)

Link to comment
Share on other sites

  • 1 month later...
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
Link to comment
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
Link to comment
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.

Link to comment
Share on other sites

  • 6 months later...

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. 

 

Link to comment
Share on other sites

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