Optional auto execution of command / macro on startup
Optional auto execution of command / macro on startup
When I'm starting Far, I want to decide (on the command line) to auto-execute a macro.
Something like flags = "RunAfterFARStart", but optional - controlled from the command line.
Is it possible?
Something like flags = "RunAfterFARStart", but optional - controlled from the command line.
Is it possible?
-
- Posts: 6836
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Optional auto execution of command / macro on startup
1. Could you show a real-life example where it would be useful?
2. A macro may start with a message box asking the user if he wants to execute that macro so the user can either cancel or continue the execution.
2. A macro may start with a message box asking the user if he wants to execute that macro so the user can either cancel or continue the execution.
Optional auto execution of command / macro on startup
My system's environment is set via Far's "Environment Manager" plugin.
When Windows starts I want to auto-start a specific command, using that environment.
So basically I want to start Far and from within Far launch that command.
But when I manually start Far later (when the system is already running) I don't want it to auto-start that command anymore.
When Windows starts I want to auto-start a specific command, using that environment.
So basically I want to start Far and from within Far launch that command.
But when I manually start Far later (when the system is already running) I don't want it to auto-start that command anymore.
-
- Posts: 6836
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Optional auto execution of command / macro on startup
You can add an environment variable for that purpose, e.g. "MySystemStarted".
Your auto-starting macro first checks that variable:
if it is already set then the macro returns, otherwise it sets that variable and runs the plugin command.
Your auto-starting macro first checks that variable:
if it is already set then the macro returns, otherwise it sets that variable and runs the plugin command.
Optional auto execution of command / macro on startup
Perhaps there is a way to invoke a specific macro from the command line that starts Far?
Or maybe I can check the command line switches that Far was started with, from inside a lua script?
Or maybe I can check the command line switches that Far was started with, from inside a lua script?
Optional auto execution of command / macro on startup
kamil,
Code: Select all
>far /?
..........
-ma Do not execute auto run macros.
..........
Фар делают добрые люди
-
- Posts: 6836
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times
Optional auto execution of command / macro on startup
Yes, it is described in Far Help, e.g.:
far lua:far.Message"Hello"
or far lua:@mypath\myfile.lua
Optional auto execution of command / macro on startup
BTW, I did check in the Command Line switches of Far Help, but it wasn't there.
-
- Posts: 6836
- Joined: Thu 23 Mar, 2006 21:36
- Location: Israel
- Has thanked: 41 times
- Been thanked: 530 times