Button Help

I am trying to create a button that will copy a selected file to the destination lister and rename the file to match the folder name in the lister. I hope this makes sense.

Here is an example: I have a file 'logo.gif' and I want to highlight it and click a button that will copy it to a folder called 'P10123649'. When its done the copied file inside the folder should be called 'P1012649.gif'.

Is this possible?

Thanks for any help.

Is P10123649 the destination folder, or will the destination and new filename always be P10123649 no matter what is shown in the destination?

'P10123649' is the destination folder and it will be different every time. It will, however, always start with a 'P'

This should do it:

<?xml version="1.0"?> <button backcol="none" display="both" textcol="none"> <label>Copy as dest folder name</label> <icon1>#newcommand</icon1> <function type="normal"> <instruction>@nofilenamequoting</instruction> <instruction>Copy AS=&quot;{destpath$|nopath}{file$|ext}&quot;</instruction> </function> </button>

Hi Nudel,
I almost wrote a reply to this thread before you answered it,
but I didn't know how to do the {file$|ext} part.

I don't see this the logic of this combination in the manual.
Perhaps this needs to be added to the Control Codes section of the manual ?

To quote the manual on this subject:

[quote]This code and all others that return the name of a file or files can take an optional flag which allows you to
strip or replace the filename extension. For example,
{filepath|noext} strips the filename extension from the filename returned
{filepath|ext=tmp} replaces the filename extension with .tmp[/quote]

Regards,
Zippo

P.S. I'll read the forums again a two weeks.
I'm on a backpacking Holiday to a remote Island as of Sunday afternoon.
Well, actually, I make a base camp and day hike it from there.
Can't imagine 20 - 35 km hikes otherwise !
Must be my back !

Almost bugged out now !

I works perfectly. Thanks. I am trying to get my supervisor to purchase this software for us and this will help. The software is Great and the support here matches.

Thanks again.