Macros I use: Extract archive to "directory"

Here you can discuss any topic concerning Far macro commands.
Locked
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Macros I use: Extract archive to "directory"

Post by jonib »

Hi all macro lovers :)

As there is no activity here which I think is sad, so I though I would post some macros i use.

This is a macro I use from the "File associations" menu it uses "Macro:post"

For any archive format I use, I have this macro in the "execute command" section:
Filemask:

Code: Select all

*.cue,*.iso,*.bin,*.mdf,*.zip,*.rar,*.ccd,*.nrg,*.img,*.cab,*.bz2,*.tar,*.jar,*.ace,*.7z
Description:

Code: Select all

Extract to !.\
Command:

Code: Select all

Macro:post %path=fsplit(panelitem(0,0,0),4); ShiftF2 $IF (dialog && Title == "Extract") $Text %path\ Enter $IF (dialog && Title == "Extract") a $End $Else $End
Command should be on one line.
The macro will extract any archive FAR supports to a directory with the same name as the archive.

And to get a menu to choose this command from I have this macro higher in the list with the same archive extensions in the "execute command" section:
Filemask:

Code: Select all

*.cue,*.iso,*.bin,*.mdf,*.zip,*.rar,*.ccd,*.nrg,*.img,*.torrent,*.cab,*.par2,*.sfv,*.7z,*.bz2,*.tar,*.jar,*.ace
Description:

Code: Select all

Enter archive
Command:

Code: Select all

Macro:post ctrlpgdn
It is just a press of CTRL Pagedown to get in an archive.

Hope this is useful.
jonib
jonib
Posts: 70
Joined: Thu Mar 31, 2005 3:00 am
Location: Sweden

Update to macro

Post by jonib »

I have updated the macro to stop if anything other than the archive extract dialog is displayed after the macro presses ShiftF2.

I had a bad .RAR archive and the macro did not check for that.

jonib

ps
Am I the only one using/interested in macros? :cry:
HaRT
Posts: 100
Joined: Thu Mar 09, 2006 6:33 pm
Location: St. Petersburg, Russia

Re: Update to macro

Post by HaRT »

jonib wrote:Am I the only one using/interested in macros?
Many people use macros a lot. But most of these users stick around the Russian forum.
Locked