Jump to content

Using snippets in Sketch


Recommended Posts

I'm a frequent user of the snippets feature. Sadly I can't really use it in https://www.sketch.com/ as it always pastes plain text as Helvetica, 12pt.

 

sketch-alfred.gif

 

Is there anything Alfred (or I) can do to fix this? Does something similar happen in other apps?

 

Copying the text, pressing CMD + Z and pasting it again will paste it as plain text. I also often type the snippet in Alfred, copy the text and paste it into Sketch. That works too, but it's not quite as clean and productive as directly using snippets in the app.

 

macOS Mojave 10.14.5 / Alfred 4.02 / Sketch 53.2

Edited by medienbaecker
Not solved after all
Link to comment
  • vitor changed the title to [SOLVED] Using snippets in Sketch

Sorry for the monologue…

 

I noticed that changing the "Paste" shortcut (obviously) has some disadvantages. For example inserting images etc. will be changed to ⌥⇧⌘V too.

 

Could Alfred detect Sketch and use the normal paste shortcut instead of the ⌥⇧⌘V one?

Link to comment
2 hours ago, medienbaecker said:

Could Alfred detect Sketch and use the normal paste shortcut instead of the ⌥⇧⌘V one?

 

Technically, yes, but I think you should be asking Bohemian to change Sketch's non-standard behaviour instead of asking the developers of other applications to work around it.

 

This isn't unique to Alfred and Sketch. It's how Sketch—in contrast to basically every other application—treats any pasted plaintext, and so you have the same problem using Sketch with every snippet expansion app, clipboard manager etc.

 

Edited by deanishe
Link to comment
5 hours ago, deanishe said:

 

Technically, yes, but I think you should be asking Bohemian to change Sketch's non-standard behaviour instead of asking the developers of other applications to work around it.

 

This isn't unique to Alfred and Sketch. It's how Sketch—in contrast to basically every other application—treats any pasted plaintext, and so you have the same problem using Sketch with every snippet expansion app, clipboard manager etc.

  

 

I totally agree. Bohemian's decision to flip the paste shortcuts is super frustrating.

 

Nevertheless, it's not the case with every snippet expansion app. I just installed aText to test this:

 

atext.gif.be457ed0fd6c56d843edc021395a5a20.gif

Somehow, aText seems to paste "cleaner" snippets without formatting. Similar to my aforementioned fix: I expand the snippet in the Alfred input, copy it and then paste it into Sketch.

Link to comment

Interesting.

 

By the looks of it, aText simulates typing rather than putting the snippet on the clipboard and pasting it. If you turn on the below option it also does the Helvetica 12pt thing.

 

image.png.66b833d9cfb81ef96efc1caccee4a39a.png

 

After a bit of testing, it looks like aText switches to using the clipboard after a certain length (simulating typing is a lot slower than pasting).

Edited by deanishe
Link to comment
28 minutes ago, deanishe said:

aText simulates typing

You're right — after enabling the clipboard checkbox I once again get Helvetica, 12pt.

Seems like simulating keystrokes is the only solution then — apart from detecting Sketch. Is this something Alfred could do?

 

After some more research on Sketch boards/subreddits, I doubt Bohemian will ever change the paste behaviour.

Link to comment
Just now, medienbaecker said:

Is this something Alfred could do?

 

In what sense? Something you could do with Alfred or something Andrew could rewrite Alfred's snippet engine to do?

 

1 minute ago, medienbaecker said:

After some more research on Sketch boards/subreddits, I doubt Bohemian will ever change the paste behaviour.

 

Huh. Did they give a reason?

Link to comment
7 minutes ago, deanishe said:

Something you could do with Alfred or something Andrew could rewrite Alfred's snippet engine to do?

 

I don't know if such a feature would help with other issues or other apps. I noticed aText's method is quite a lot faster for short snippets.

Of course it would be a total overkill just to get this one stupid app working.

 

There's no possibility to override the snippets functionality via workflows or so, right?

 

15 minutes ago, deanishe said:

Huh. Did they give a reason?

 

Not exactly. I just noticed it took them years to even add the possibility to choose between rich text and plain text.

I'll definitely try my luck, though! Thanks for your help @deanishe! 

 

Link to comment
1 minute ago, medienbaecker said:

I don't know if such a feature would help with other issues or other apps. I noticed aText's method is quite a lot faster for short snippets.

Of course it would be a total overkill just to get this one stupid app working.

 

Yeah, I think that's a good summary of the situation. It's not a simple change, so I couldn't really see Andrew implementing it unless it fixed issues with several applications.

 

I've been thinking about this a bit, and what you could do is write a simple workflow that types the text you enter into Alfred. So, you'd run your workflow (probably via a Hotkey), expand the snippet in Alfred's query box, and then when you hit ↩, the workflow inserts the snippet in the active app by typing it instead of pasting it.

Link to comment

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