mwieder wrote: Fri Sep 02, 2022 3:58 pm
Stam-
Very interested. A while back I worked out a mechanism for automatically importing script-only stacks as substacks but got bogged down in automatically exporting changes back to the .livecodescript files. Haven't revisted that in some time now. So if you've got something workable and generic then yes, I've got a use for it.
Sure - there's a few more things to fine tune on my end and i'll post it, probably in a new thread - my actual job and free time permitting... In any case, feedback is always good.
This is a sidetrack i fell into while working on a much larger app, after FerrusLogic released their add-on that allowed me to edit scripts in VSCode and made me keen to use VSCode for as much as possible... It's just taken a lot more time than i expected
This solution of course heavily influenced by my needs and may not fit your use-case - i don't for example import *any* SO stacks as substacks, i either set the SO stack to be behaviour for card or stack, or 'start using' it as a library, or 'insert it into back' so the handlers are always accessible from anywhere. I expect this will be using at least 20 SO stacks, if not more, in my 'main' app and having to hand code the load/unload handlers would be cumbersome to maintain otherwise (as i discovered after my initial attempts at this technique...)
Anticipating i would forget 50% of what i've done in a year or two i've added some in-app documentation for myself, but can polish it up as well so it's readable by human beings (this was also a opportunity to create my own version of an 'accordion' control, another sidetrack

)
The main issue for now is: i created this with the new
polyList and
powerButton widgets (mainly to test these - and i do like them), so to run this as is, you'd either need these widgets installed or i could build this as a standalone...
The stack does 3 things: It creates a 'paths' SO stack that returns the correct locations for SO stacks depending on whether in IDE (all in one folder, or subfolders of this one folder) or standalone (read-only or writeable locations), and then creates a couple of scripts to load and unload these using data from the 'paths' stack (to be pasted into the main stack's script)
The load/unload scripts generated mean that i can with one call load all stacks immediately (eg at startup) and running unload/load scripts allow me to reload all scripts pretty much instantly after editing externally.
If SO stacks change (new files, different names etc), I just generate new scripts (hand-coding these gets very tedious very quickly).
I envisioned this to work as a plugin (eventually), but no reason really why this couldn't work as a standalone...
On the other hand the underlying code can take datagrids with no change, i could just put a datagrid and normal buttons in instead of polyList/powerbuttons...
I haven't looked into it, but presume there's a straightforward way to check for presence of a specific extension like polyList; i could just add some cards with datagrid as well and have it automatically switch depending on whether people have polyList... (a bit more work on my end!)
S.