Macro to start new FAR window with the same panels
-
- Posts: 129
- Joined: Sun 08 Jan, 2012 08:23
- Location: Czech Republic
- Has thanked: 2 times
- Been thanked: 1 time
Macro to start new FAR window with the same panels
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
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
-
- Posts: 129
- Joined: Sun 08 Jan, 2012 08:23
- Location: Czech Republic
- Has thanked: 2 times
- Been thanked: 1 time
Re: Macro to start new FAR window with the same panels
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....)?
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....)?
-
- Posts: 6840
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Re: Macro to start new FAR window with the same panels
Here is your macro made a little shorter:
Code: Select all
printf('start "" "%%farhome%%\\far.exe" %q %q',APanel.Path,PPanel.Path) Keys("Enter")
I don't know.KlepetoX wrote:Is there any possibility to clone (start new) FAR with the same panels, even plugin panels (FTP, ArcLiete....)?
-
- Posts: 129
- Joined: Sun 08 Jan, 2012 08:23
- Location: Czech Republic
- Has thanked: 2 times
- Been thanked: 1 time
Re: Macro to start new FAR window with the same panels
Hello Shmuell, thank you, this is much more better.
I only had to edit macro this way:
After this correction it starts with the same console parameters (Font, Height, Width) instead of defaults (80x25 and another font).
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")
-
- Posts: 6840
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Re: Macro to start new FAR window with the same panels
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")
-
- Posts: 129
- Joined: Sun 08 Jan, 2012 08:23
- Location: Czech Republic
- Has thanked: 2 times
- Been thanked: 1 time
Re: Macro to start new FAR window with the same panels
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?
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?
-
- Posts: 6840
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Re: Macro to start new FAR window with the same panels
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")