View Full Version : multiple unzipping
poldoy
01-13-2003, 02:40 PM
I have selected multiple items in the listbox, then I would like to extrac all this items (zips) at once to a folder.
But it seems this options is not available, I can only extract just 1 for time, is that correct?
Thanks
Derek
01-13-2003, 10:54 PM
Yes! You can not extract more than one zip file at a time, so you'll have to list them seperately.
I believe it was suggested to allow wildcards in the zipfile name.
You could use a While loop to unzip each one individually.
Displayed Version:
%SelectedIndex% = ListBoxObject[ListBox1].GetSelected
IF (%SelectedIndex% != "")
%NumSelected% = String.CountDelimitedStrings ("%SelectedIndex%", ";;")
%Ctr% = "0"
WHILE (%Ctr% < %NumSelected%)
%NewIndex% = String.GetDelimitedString ("%SelectedIndex%", ";;", %Ctr%)
%File% = ListBoxObject[ListBox1].GetItemText (%NewIndex%)
ZipFile.Extract ( "%SrcDir%\%File%", "*.*", "%TempDir%")
%Ctr% = Evaluate (%Ctr% + 1)
END WHILE
ELSE
%Result% = Dialog.MessageBox ("Selection", "Please select an item in the l...", Ok, Question)
END IF
-----------Cut and Paste---------------
<IR_ACTIONS_LIST>
<Action name="Get Selected">
<Type>126</Type>
<Function>0</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<TargetListBox>ListBox1</TargetListBox>
<Variable>%SelectedIndex%</Variable>
<VariableDelimiter>;;</VariableDelimiter>
</Action>
<Action name="IF">
<Type>200</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Condition>%SelectedIndex% != ""</Condition>
</Action>
<Action name="Count Delimited Strings">
<Type>63</Type>
<Function>0</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%NumSelected%</Variable>
<Source>%SelectedIndex%</Source>
<Delimiter>;;</Delimiter>
</Action>
<Action name="Set Value">
<Type>6</Type>
<Function>0</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%Ctr%</Variable>
<Value>0</Value>
<Evaluate>0</Evaluate>
</Action>
<Action name="WHILE">
<Type>204</Type>
<Function>1</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Condition>%Ctr% &lt; %NumSelected%</Condition>
</Action>
<Action name="Get Delimited String">
<Type>64</Type>
<Function>0</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%NewIndex%</Variable>
<Source>%SelectedIndex%</Source>
<Delimiter>;;</Delimiter>
<ItemIndex>%Ctr%</ItemIndex>
</Action>
<Action name="Get Item Text">
<Type>117</Type>
<Function>0</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<TargetListBox>ListBox1</TargetListBox>
<GetType>2</GetType>
<Index>%NewIndex%</Index>
<IndexDelimiter>;;</IndexDelimiter>
<Variable>%File%</Variable>
<VarDelimiter>;;</VarDelimiter>
</Action>
<Action name="Extract">
<Type>131</Type>
<Function>0</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<ZipFileName>%SrcDir%\%File%</ZipFileName>
<FilesToExtract>*.*</FilesToExtract>
<Delimiter/>
<UnzipToFolder>%TempDir%</UnzipToFolder>
<RecurseSubDirs>1</RecurseSubDirs>
<UseInternalDirs>1</UseInternalDirs>
<UsePassword>0</UsePassword>
<Password/>
<OverwriteOptions>2</OverwriteOptions>
<ShowDialog>1</ShowDialog>
<DialogTitle>Unzipping Files</DialogTitle>
</Action>
<Action name="Set Value">
<Type>6</Type>
<Function>0</Function>
<DTIndentLevel>2</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<Variable>%Ctr%</Variable>
<Value>%Ctr% + 1</Value>
<Evaluate>1</Evaluate>
</Action>
<Action name="END WHILE">
<Type>205</Type>
<Function>1</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="ELSE">
<Type>206</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
<Action name="Message Box">
<Type>5</Type>
<Function>0</Function>
<DTIndentLevel>1</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
<DialogTitle>Selection</DialogTitle>
<DialogMessage>Please select an item in the list?</DialogMessage>
<Icon>3</Icon>
<Variable>%Result%</Variable>
<DialogType>0</DialogType>
<DefaultButton>0</DefaultButton>
</Action>
<Action name="END IF">
<Type>201</Type>
<Function>1</Function>
<DTIndentLevel>0</DTIndentLevel>
<Enabled>1</Enabled>
<ErrorHandling>
<UserNotificationMode>2</UserNotificationMode>
<CustomErrorMessage/>
<OnErrorAction>0</OnErrorAction>
<JumpToLabel/>
</ErrorHandling>
</Action>
</IR_ACTIONS_LIST>
------End Cut and Paste----------
poldoy
01-14-2003, 01:04 PM
cool Worm, I will try immediately.
Thanks!
It worked, thanks again /ubbthreads/images/icons/wink.gif
Powered by vBulletin™ Version 4.0.6 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.