IloveComputers82 Posted September 3, 2017 Share Posted September 3, 2017 Hi, I have an image that I made in photoshop, that I frequently paste into emails. I want to be able to instantly paste this image with a hot key. I have attempted to program Alfred to accomplish this but I have not yet succeeded. Any advice is greatly appreciated, thanks! Link to comment
deanishe Posted September 3, 2017 Share Posted September 3, 2017 You need to write a script or program that copies the image you want to the clipboard. Then Alfred can run the it and subsequently trigger the paste action. See here. Link to comment
GuiB Posted September 4, 2017 Share Posted September 4, 2017 (edited) I've been using an applescript to copy files, so here is a version for your purpose that copy an image file and paste it to your front application. Since you said this is for an email I thought this was for an email signature, so I added an example for that using the snippet trigger (the hotkey one is set as well, but actually, any trigger could work...) Link to the workflow: https://nofile.io/f/UpBdhu7mcuP/ImagePaste.alfredworkflow For those that want to see the script directly, here is the main script to copy the file to the clipboard (just put this in a Run Script set to Applescript), the rest is just a simple cmd+v key combo for the pasting. on run (argv) set filePath to "/path/to/your/file" set the clipboard to POSIX file (POSIX path of ((POSIX file (filePath)) as alias)) end run Hope this helps! Edited September 4, 2017 by GuiB Link to comment
GuiB Posted September 4, 2017 Share Posted September 4, 2017 I just thought that I would add a note to my post above since I think I badly named the workflow... so please note that the script above doesn't only works for image file but could be used to copy any file to the clipboard Link to comment
IloveComputers82 Posted September 4, 2017 Author Share Posted September 4, 2017 Thanks all for the advice!!!! Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now