Jump to content
Matty

Snippet with images (need a workflow)

Recommended Posts

am trying to make a snippet with images in it.
 
I notice that when I copy an image it shows up in Alfred to paste with the clipboard manager, but does not work for snippets.
 
Any way around this?

Share this post


Link to post

Hello, I'm having the same issue as well...

This was the main reason why I bought the Powerpack for Alfred4 and it's not working.

Any word from Alfred's team? 

Share this post


Link to post

@Matty and @egmweb, sorry I wanted to send it to you sooner, but I'm quite busy at the moment, but here is a workflow as example that I have uploaded some of those tips many months ago. The RTF example inside it is not useful anymore with Alfred 4, but you can have a look at the Expand Image example and the RTFD example. In short, you need to create a file with the content that you want for expansion and use it has the file path for the script inside that is connected after the Snippet Trigger. Just copy and paste the one that is useful to you into a new workflow and change the file path + the Snippet expansion keyword and you should be good.

 

Example Workflow: https://d.pr/f/PCcxuP

 

Best

Share this post


Link to post

@GuiB,

 

Thank you for the response, although I am still having issues, I can't get it to post 1 image, and ideally I would like it to be able to post text + several images all in different places.

 

EDIT: got it to post 1 picture, how to post text + multiple pictures in different places ?

 

Example:

 

Text

image

 

text

image

image

text 

 

etc..

Edited by Matty
more info

Share this post


Link to post

@Matty To expand to multiple types (text + image), you can use an RTFD file or by chaining multiple of the examples (by inserting delay in between if needed)... Here is the same workflow but I added another example with chained items (Image  + Text).

 

Workflow: https://d.pr/f/iy98Ne

Share this post


Link to post

Also, if you need to change field between different outputs, you can add a "Dispatch Key Combo" key object to insert a TAB or ENTER or anything else (like to CMD+V that I use inside the workflow to paste the image) that you would normally do in-between you different expansions

Share this post


Link to post
On 6/30/2019 at 9:00 AM, GuiB said:

@Matty and @egmweb, sorry I wanted to send it to you sooner, but I'm quite busy at the moment, but here is a workflow as example that I have uploaded some of those tips many months ago. The RTF example inside it is not useful anymore with Alfred 4, but you can have a look at the Expand Image example and the RTFD example. In short, you need to create a file with the content that you want for expansion and use it has the file path for the script inside that is connected after the Snippet Trigger. Just copy and paste the one that is useful to you into a new workflow and change the file path + the Snippet expansion keyword and you should be good.

 

Example Workflow: https://d.pr/f/PCcxuP

 

Best

how do I find the POSIX file path? As shown in the script description for the workflow! 

I am an amateur!!

Share this post


Link to post
On 2/24/2020 at 2:48 PM, Nabil said:

how do I find the POSIX file path? As shown in the script description for the workflow! 

I am an amateur!!

@Nabil, for the script, you need to change the `"/path/to/your/image"`  in the line:

 

set filePath to "/path/to/your/image"

to the path of your file.

 

You can get the file path using the Alfred File Action named "Copy Path to Clipboard" or the 'Copy "fileName" as Pathname' that you can get while doing a secondary click on the file in the Finder and holding the Alt key  (like explained here: https://osxdaily.com/2015/11/05/copy-file-path-name-text-mac-os-x-finder/ )

Share this post


Link to post
3 hours ago, GuiB said:

@Nabil, for the script, you need to change the `"/path/to/your/image"`  in the line:

 


set filePath to "/path/to/your/image"

to the path of your file.

 

You can get the file path using the Alfred File Action named "Copy Path to Clipboard" or the 'Copy "fileName" as Pathname' that you can get while doing a secondary click on the file in the Finder and holding the Alt key  (like explained here: https://osxdaily.com/2015/11/05/copy-file-path-name-text-mac-os-x-finder/ )

945716979_ScreenShot2020-02-26at10_22_13AM.thumb.jpg.4d0967b69f06cb7208df596b57b101a0.jpg

 

Im talking about the second line!?

Share this post


Link to post
6 hours ago, Nabil said:

Im talking about the second line!?

 

Actually, you don't need to edit that line. The `filePath` string that is mentioned here is simply a variable that refers to the `filePath` string from the first line.

 

I mean, the first line is simply there to set a variable to the file path that you want and then this variable is used later in the script. I put it there at the top so it is easy to see and make it clearer.

 

Hope this helps!

Share this post


Link to post
2 hours ago, GuiB said:

 

Actually, you don't need to edit that line. The `filePath` string that is mentioned here is simply a variable that refers to the `filePath` string from the first line.

 

I mean, the first line is simply there to set a variable to the file path that you want and then this variable is used later in the script. I put it there at the top so it is easy to see and make it clearer.

 

Hope this helps!

Yes, finally!

 

it works perfectly for me in Whatsapp desktop, google keep, but image is not being pasted in word and spark mail client!!

Also pdf pasting works in mail client!

Edited by Nabil

Share this post


Link to post

I ran into the same problems as you did, that's why I've created this:

 

There's a bit more to get it to work, but I believe it's simple enough

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