Quick question about button

Hi,

once I select a file, what I would like to do is....

  1. copy the file
  2. paste the file
  3. rename the copy to folder.jpg
  4. resize the folder.jpg

Steps 1,2,4 are easy enough to do, but what I do not know how to do is once the copy is pasted, how to have the system auto select that file in order to rename it to folder.jpg.

Is there a way to handle that? perhaps have it make a batch file called test.bat .... copy the file into that directory, rename the file once in that directory, resize it and then move it back. once done, then delete the test.bat and the test folder. Not sure if that is the best way or not. If so, I am not too sure about the syntax.

Any help would be appreciated

Thanks

You can eliminate steps 1-3 and replace them with:

Copy HERE AS folder.jpg

Then you need:

Select folder.jpg
Image CONVERT

(add arguments as desired to the Image CONVERT command)

Copy HERE AS folder.jpg
Select folder.jpg
Image HEIGHT=320 WIDTH=240 REPLACE PRESERVEASPECTRATIO HERE

here is what i did, but the script is a little wonky....

if the original file is called picture.jpg..... what happens is it copies picture.jpg to folder.jpg (which is fine), but then it resizes picture.jpg not folder.jpg.

So i ran the script without the 3rd line, and it does not select folder.jpg

Ah ok - try sticking a Go REFRESH in after the Copy command.

Kewlies... mucho gracias :slight_smile:

There have been many topics in the past involving multiple commands.
Various 'tricks' have been used when the multiple DOpus commands fail because a command begins before the previous command has completed.

These 'tricks' range from Prefixing certain lines with either Dopusrt /cmd or Sync:Dopusrt /cmd, to using Dos commands to accomplish certain commands in Batch File Mode, to writing command line programs, to discovering what Dopus commands one can 'safely' append another line to, to User Functions.

I'm not certain Jon implied that the Image CONVERT could be run on the same button,
but Jon's suggestion actually works with reasonable size images for a resultant folder.jpg.

I have the curse ( advantage ) of an old computer for at least a few more months.
I am building a new one , Really !

I attempted to use 28.1 MB, 5 MegaPixel Tif Images to accomplish this.
I used Jon's code with more success, and this modified version with less success.

Copy To {destpath} AS folder.jpg Go {destpath} Select folder.jpg Image CONVERT

With reasonable size images for a resultant folder.jpg this works.
However, with 28.1 MB Tifs, the Convert dialog either doesn't display at all, or I just see a flash before it closes.
Apparently folder.jpg didn't properly exist yet ( my guess ).
However, in the end, folder.jpg is properly selected.

If I prefix the Image Convert line with sync:DOpusrt /cmd, the Select folder.jpg then fails.

This is one reason why I've favored writing my own amateur command line programs , or 4NT scripts for my more complex button tasks.

:opusicon: Porcupine

edit note: The previous three posts were made as I was writing this, and I hadn't read them yet.

Actually this is all over-engineered - all you need is this:

Image HEIGHT=320 WIDTH=240 PRESERVEASPECTRATIO HERE AS folder.jpg

Thanks Jon !

:opusicon: Porcupine