Feature request: application start/exit-time script

Features wanted...
bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Feature request: application start/exit-time script

Post by bdeshi »

Hey Don, I think someone had asked for this before, but please could you add this? Look, I even made a changelog entry that explains everything!

Code: Select all

v15.40.0*** - 2015-0*-** **:**
  +++ Introducing Startup/Exit scripts: scripts that run at XY startup and exit.
      Create two scripts as <xypath>\_Initialize.xys and <xypath>\_Terminate.xys.
      The first one will be executed right after XY is started and the second one
      just before quitting.
      This way, you can stop (ab)using shortcuts and commandline arguments to run
      XYplorer with certain commands. Just add them straight to _Initialize.xys.
      Notes:
      - Hold SHIFT while XYplorer is starting to skip loading the Startup script,
        similarly, hold SHIFT and quit XYplorer to skip loading the Exit script.
      - New instances started with /fresh commandline option or via SC ::fresh or
        ::freshhere do not load these scripts.
    + Configuration | Startup & Exit: Added option "Load Startup/Exit scripts".
      Factory default is off.
    + Added new command: File | Exit Without Loading Exit script.
    + SC exit enhanced: Added new mode 'x', for to startup/exit scripts.
      Syntax: exit [mode]
        mode:
              x  = skip loading startup/exit scripts.
      example:
              :: exit 'xn'; //exit with saving, without loading exit script
              :: exit 'xr'; //restart, without loading either exit/start script
    + Added new commandline option /noinitscript to start XY without loading the
     startup script.
now you tell me, isn't that just asking to be added to XY? almost all prowertools have init scripts!
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Stef123

Re: Feature request: application start/exit-time script

Post by Stef123 »

SammaySarkar wrote: Look, I even made a changelog entry that explains everything!
Hehe :titter: - quite a good idea, actually :tup: can be used as a basis for the real thing that follows later :biggrin:

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Feature request: application start/exit-time script

Post by SkyFrontier »

Unnoficial website and help typos:
- New instances started with /fresh commandline option or via SC ::fresh or
::freshhere DO not load these scripts.

:biggrin:
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Feature request: application start/exit-time script

Post by Marco »

Code: Select all

Hold SHIFT while XYplorer is starting to skip loading the Startup script
How can you pass a modifier key when double-clicking an executable? I don't think it's possible.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Feature request: application start/exit-time script

Post by bdeshi »

open XYplorer, and then hold SHIFT, till it's started. Since the script runs after XYplorer has started completely (gained all senses), it can check to see if SHIFT is pressed. Besides It's still just a idea, the job of making it a foolproof complete feature is in Don's hands! :kidding:


@TypoFrontier: typo done fixed! :P
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

ksarnelli
Posts: 154
Joined: 13 Dec 2014 04:48

Re: Feature request: application start/exit-time script

Post by ksarnelli »

I like this idea...a lot! Maybe even have a way to mark an existing script to become the startup or exit script.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Feature request: application start/exit-time script

Post by TheQwerty »

Code: Select all

. . .
<xypath>\_Initialize.xys and <xypath>\_Terminate.xys.
. . .
Why <xypath>?

Either the scripts should be in <xyscripts> or they should be configuration options.
Possibly with support for also specifying them within Admin.ini.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Feature request: application start/exit-time script

Post by bdeshi »

my idea of giving the impression that these scripts are VIP. Also to prevent tampering somewhat. Not a critical rule though.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Feature request: application start/exit-time script

Post by bdeshi »

bumpling
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 64841
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Feature request: application start/exit-time script

Post by admin »

Yeah, maybe not even that bad. ;) I especially like the ready-made change log. That's the way to go, guys! :tup:

Small question: Should this script be loaded before or after the one passed via command line (if any)?

Please bumple again after 15.70 is out.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Feature request: application start/exit-time script

Post by bdeshi »

Running /script= first sounds right. Since there will be a cmdline switch to block these scripts, it makes sense if all cmd args are processed first.

Gleefully awaiting to remind of yet another super feature! :tup:

edited.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

PeterH
Posts: 2826
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Feature request: application start/exit-time script

Post by PeterH »

Wish in general: :tup: :tup: :tup:

But: scripts may depend on Perm Variables set by Init Script - so I would first start Init Script, then /script=
(There might be an XY-var to query for existence/name of a /script= in Init Script.)

PeterH
Posts: 2826
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Feature request: application start/exit-time script

Post by PeterH »

Code: Select all

    + Configuration | Startup & Exit: Added option "Load Startup/Exit scripts".
      Factory default is off.
Isn't it better then to define the name of the script, instead of just a flag? In this case no name says "No Init Script", and I could specify e.g. system\init.xys (or whatever) to request it's name and also (sub-)location.
(I already have a \system directory in <xyscripts> :roll: )

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Feature request: application start/exit-time script

Post by bdeshi »

admin wrote:Please bumple again after 15.70 is out.
woah, 80's are here already! badabump! :ghost:
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

autocart
Posts: 1354
Joined: 26 Sep 2013 15:22

Re: Feature request: application start/exit-time script

Post by autocart »

No use to bump now that Don is on vacation.
Especially since he sometimes seems to be overwhelmed by the many posts after he comes back...
Need to wait with bumping until he is here again. ;-)

Post Reply