Button to copy Adobe image data as *.jpg

Hi friends, I would like to create a command that I run from a button to paste copied data from Photoshop as a *.jpg in a folder. Let’s say the name is now temp.jpg. I would then like it to continue and copy temp.jpg that was created to the clipboard. I also want it to overwrite the file temp.jpg each time. I want this because Directory Opus seems to be the best way to quickly paste Adobe (Photoshop, Illustrator, InDesign) data as a *.jpg so other programs do not have trouble with the format. Thanks

Clipboard PASTE=jpg:25 AS C:\DOClip\temp.jpg
//Clipboard SET "C:\DOClip\temp.jpg"
// the line above seems to create some recursive error in this case?
// How do I make it overite or just delete C:\DOClip\temp.jpg each time?

Edited: Also I should add that if I Right Click on C:\DOClip\temp.jpg in a folder and copy, I get exactly what I want when pasting into other applications. However, it seems that when I use the Opus command it does something different. When I go to the other application to paste it, nothing will paste (like it is the wrong type of data). Thanks

Try Clipboard COPY instead of Clipboard SET.

lxp
Try Clipboard COPY instead of Clipboard SET .

Super, thanks of the reply! That works great. Now I don't have an extra manual back and forth to paste over and over. Because Directory Opus is so great I can really automate this with a *.dcf. Right now I am mainly using (and was having the problem) when pasting image content into a FileMaker database. Adobe is the choice for image selection (all other programs fall short). So when I would paste it would show up as a WMF format instead of JPG. FileMaker executes a script to insert the pasted image. I can put launching the *.dcf in that script.

Delete FORCE QUIET "C:\DOClip\temp.jpg"
Clipboard PASTE=jpg:25 AS "C:\DOClip\temp.jpg"
Clipboard Copy AS C:\DOClip\temp.jpg

Thank You again! :slightly_smiling_face:

The Clipboard COPY command does not use the AS argument, so that bottom line should be just Clipboard COPY.

Even then, I am not sure why that command would work, since it isn't being told which file to place in the clipboard. The only way I can see it working is if you are already looking at C:\DOClip when you run the button, so that the temp.jpg file is selected as it is created, which then causes the last line to put that file in the clipboard. Otherwise, the last line would either place some other file (that was already selected in the folder you're in) or do nothing.

If it's appearing to work as-is, it might just be that the program you are pasting into accepts the original bitmap data that's still in the clipboard.

(You should be able to reliably perform the three steps using a script, if needed.)

I see, so now I will at least know how to work with the Clipboard COPY command better. I really wanted to test this more to give a viable answer. I wanted to post back here so if any other member needed this it would be a resource. The problem is that I have not been able to figure out what is going on, one with how Adobe copies to the clipboard, and two why the original help from @lxp seemed to work. I have managed to get it to work well for my purpose. I am still using the first two lines of the original code above. The ability to launch them as a *.dcf is super helpful. I then use the help of a program that can trigger when the temp file is changed. At this point, the other program has the ability to re-write the file as a bitmap. If any user wants more specific instruction of what I did I will gladly share. I will keep trying to learn and understand about this and If I get any more conclusive evidence or ideas (how to get it to work) I will post. For now, as usual, Thank so much!

When I made my suggestion I assumed Clipboard COPY would accept a path/filename just as Clipboard PASTE AS. But it really only works on selected files and folders. So this stuff working was more of a lucky punch than actual knowledge :wink:

To work consistently the button should probably look like this:

Delete FORCE QUIET "C:\DOClip\temp.jpg"
Clipboard PASTE=jpg:25 AS "C:\DOClip\temp.jpg"
GO PATH=C:\DOClip
Select NONE
Select temp.jpg
Clipboard COPY

In the next update we'll add a FILE argument which will let you specify the files to be placed in the clipboard on the command line. E.g. the above command could become:

Delete FORCE QUIET "C:\DOClip\temp.jpg"
Clipboard PASTE=jpg:25 AS "C:\DOClip\temp.jpg"
Clipboard COPY FILE "C:\DOClip\temp.jpg"
1 Like

I see the sense there. Wow that will be great! Thanks so much you guys are fantastic.

This is ridiculously great! Thanks

The command as typed was working for a while, now it is not. Has something changed in an update? Thanks

Nothing should have changed as far as I know.

What happens? The command does three things. Which is failing? Is there an error message?

My mistake Leo there was something changing the clipboard on my system. It is working the same way. Thanks so much!