Macros I use: Extract archive to "directory"

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

Macros I use: Extract archive to "directory"

Postby jonib » Mon Oct 01, 2007 4:41 pm

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

Postby jonib » Fri Dec 14, 2007 2:29 am

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

Postby HaRT » Fri Dec 14, 2007 10:38 am

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.


Return to “Macro Commands Discussions”

Who is online

Users browsing this forum: No registered users and 1 guest