Create Zip from flatview (including full paths, obviously)?

Is it possible to have a single button that could be used when in Flatview (mixed no folders, if it matters) to Zip up the selected files? I would like the button to prompt the user for a file name (the prompt should have 'Archive' as the selected default name). Obviously, because the user may have selected 2 files with the same name but in different folders, I need the full path to the files to be included in the Zip.

I have a button that I thought was fine but it doesn't work when the user is in Flatview. The current button configuration is below.

If this is not possible, another option I have would be to feed the list of selected files to the Winzip command-line utility. However, that hinges on being able to get the list of selected files into a text file somehow. Is that possible?

Here's my current button (which I already owe to this forum and Leo. Thanks!)

@firstfileonly
@nofilenamequoting
Copy ZIP HERE CREATEFOLDER="{dlgstringS|Please enter the Zip file name.\n\nThe current date and time will be appended to the name.|Archive}- {date|yyyyMMdd}_{time|HHmmss}"

Thanks for the help.

Jason

I think this does all that you want. (Use it on its own, without @firstfileonly etc.)

Copy ARCHIVE HERE FLATVIEWCOPY=recreate CREATEFOLDER="{dlgstringS|Please enter the Zip file name.\n\nThe current date and time will be appended to the name.|Archive}-{date|yyyyMMdd}_{time|HHmmss}"

Leo,

 Thanks.  This is almost perfect.  Is there a way to get the full path not just the path relative to the folder that was flatviewed?

Jason

There is, sort of, but you'll have to click through an extra Add To Archive dialog (only way to save full, absolute paths), and the archive will end up in the same folder as the first selected file (as the Add To Archive dialog doesn't choose the default destination directory the same way as the other command when using Flat View):

Copy ADDTOARCHIVE=fullpaths FLATVIEWCOPY=single HERE CREATEFOLDER="{dlgstringS|Please enter the Zip file name.\n\nThe current date and time will be appended to the name.|Archive}-{date|yyyyMMdd}_{time|HHmmss}"

Leo,

Great! Thanks. I think the user will not mind stopping at the dialog. I might give him a button for each of the 2 options you've provided (or maybe a single dual function button).

Now I'm moving on to trying to use Opus' built-in functionality to extract the contents of the Zip. I already have a button that uses Winzip's command-line utility but I think it would be better if I could harness Opus' functionality for this so I don't have to worry about whether the user has access to the Winzip utility. I want to extract just the new/modified stuff in the Zip, ideally without any prompts. I've read the help on the COPY command and I thought I understood exactly how to do it but I guess I'm missing something because I can't get rid of the 'what do you want to do?' prompt for the existing files.

I've tried this as my most basic permutation:

Copy EXTRACT HERE WHENEXISTS=replacenewer

Let me know if I should make another thread for this admittedly new request.

Thanks, again!

Jason

I believe I figured out something that works. The 2 options I'm using seem to be somewhat redundant in a way but this it was seems to work:

Copy EXTRACT HERE WHENEXISTS=replacenewer FORCE

Am I missing something or is this the correct way to accomplish it?

Thanks,

Jason

It looks like I'm running to the same issue as reported here:

[url]Copy FORCE extract from archive doesn't force dirs]

Do you know if that dialog was overlooked in the code that tries to suppress the confirmation prompts or is it possible to suppress that 'directory' prompt?

There's no way to suppress that dialog at the moment.

Are you sure you want to extract "HERE" when the zips were created with full paths? That would presumably only be correct if "here" is the root of the drive (and all the files in the zip came from that same drive, not a mixture of drives, of course).

Good catch the 'HERE' option, thanks. I had noticed that and adjusted it myself already.

Thanks for the information about the folder prompt.

Jason

[quote="jproos"]
...

However, that hinges on being able to get the list of selected files into a text file somehow. Is that possible?

...
Jason[/quote]

The user for whom I'm working on this has expressed interest in the basic idea I described in my initial post (see the relevant section in the quoted text). It seems he has an interest in this for other purposes. Is it at all possible to select a set of files/folders then click a button in Opus 10.1 and have a new ascii file created created on the file system somewhere containing the path to each selected file?

Please start a new thread for that, since it's not related at all tot he zip stuff. (I might not answer it immediately but I will tomorrow if not tonight.)

Will do!

Thanks,

Jason