Page 1 of 1

Macro to start new FAR window with the same panels

Posted: Wed 20 Feb, 2013 19:38
by KlepetoX
I'm trying create macro to start new FAR window with the same panels as actual FAR. My macro is:

macro:post print("start %farhome%\\far ") Keys("Ctrl[ Space Ctrl] Enter")

But there's problem with "\" symbol at the end of folders between "" characters - new FAR ignore folders with this symbol at the end and starts with default folders in panels. I can use "BS" key in macro to delete "\". But it is not possible in simple way because folders may be between "" characters sometimes, sometimes not.

Example:

WORKS:
start %farhome%\far "C:\Program Files (x86)" "D:\#MUSIC\Rock\13th Floor Elevators\The Psychedelic Sounds Of.1966"

DOESN'T WORK:
start %farhome%\far "C:\Program Files (x86)\" "D:\#MUSIC\Rock\13th Floor Elevators\The Psychedelic Sounds Of.1966\"

BUT THIS WORKS ALWAYS:
start %farhome%\far C:\AMD\ D:\#MUSIC\Rock\
start %farhome%\far C:\AMD D:\#MUSIC\Rock

Re: Macro to start new FAR window with the same panels

Posted: Wed 27 Feb, 2013 07:53
by KlepetoX
Now I have this macro:

macro:post print("start %farhome%\\far ") Keys("Ctrl[ Space Ctrl] Space CtrlIns ShiftF4 c l o n e . t m p Enter CtrlV CtrlHome CtrlF7 \\ \" Tab Del \" Enter Tab Enter CtrlA CtrlC Esc N CtrlV Enter")

I call it from user menu (F2). I had to replace \" (with ") character in editor. But it is not the best solution. It clones (start new) FAR with standard panels only.

Is there any possibility to clone (start new) FAR with the same panels, even plugin panels (FTP, ArcLiete....)?

Re: Macro to start new FAR window with the same panels

Posted: Wed 27 Feb, 2013 11:28
by Shmuel
Here is your macro made a little shorter:

Code: Select all

printf('start "" "%%farhome%%\\far.exe" %q %q',APanel.Path,PPanel.Path) Keys("Enter")
KlepetoX wrote:Is there any possibility to clone (start new) FAR with the same panels, even plugin panels (FTP, ArcLiete....)?
I don't know.

Re: Macro to start new FAR window with the same panels

Posted: Wed 27 Feb, 2013 13:29
by KlepetoX
Hello Shmuell, thank you, this is much more better.

I only had to edit macro this way:

Code: Select all

macro:post printf('start %%farhome%%\\far.exe %q %q',APanel.Path,PPanel.Path) Keys("Enter")
After this correction it starts with the same console parameters (Font, Height, Width) instead of defaults (80x25 and another font).

Re: Macro to start new FAR window with the same panels

Posted: Wed 27 Feb, 2013 13:36
by Shmuel
OK. Probably, one more correction would be worthwhile:

Code: Select all

macro:post printf('start %%farhome%%\\far.exe "%s" "%s"',APanel.Path,PPanel.Path) Keys("Enter")

Re: Macro to start new FAR window with the same panels

Posted: Wed 27 Feb, 2013 15:01
by KlepetoX
Shmuel - one more question:

If I start this macro from right panel (right panel is APanel), then new FAR window has folder from the right panel in left panel and vice versa. Is there any possibility to use something like RPanel.Path and LPanel instead of APanel and PPanel?

Re: Macro to start new FAR window with the same panels

Posted: Wed 27 Feb, 2013 15:35
by Shmuel

Code: Select all

macro:post printf('start %%farhome%%\\far.exe "%s" "%s"',APanel.Left and APanel.Path or PPanel.Path,APanel.Left and PPanel.Path or APanel.Path) Keys("Enter")

Re: Macro to start new FAR window with the same panels

Posted: Wed 27 Feb, 2013 16:06
by KlepetoX
Shmuel, thank you, solved completly :-)

Re: Macro to start new FAR window with the same panels

Posted: Mon 25 Nov, 2013 11:41
by 2useven10
It should work in the far manager 3.0 'stable' or nightly build.