Editing .livecodescript files
Forum rules
A place to discuss and plan OpenSource xTalk (not exclusively LCC based) and Community Builds of LCC
Ask NOT what xTalk can do for you... get involved you DO have something to contribute, no matter your skillset!
A place to discuss and plan OpenSource xTalk (not exclusively LCC based) and Community Builds of LCC
Ask NOT what xTalk can do for you... get involved you DO have something to contribute, no matter your skillset!
- richmond62
- Posts: 3896
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Editing .livecodescript files
Well, Erm, Yes . . . one can muck around with these using some type of Text Editor . . .
HOWEVER, it "would be lovely" if one could set up a stack that could 'inject' modded code into a .livecodescript file and then save it . . .
Easy enough to make one:
- -
BUT, how do you then reopen it to edit it?
Aaaaah: dead easy: so 'my problem' [phone a psychiatrist?] is not THAT, what it is is how to open a .livecodescript file from inwith the IDE and muck it about before saving it.
AND, just for added fun, one with a 'rev' prefix.
HOWEVER, it "would be lovely" if one could set up a stack that could 'inject' modded code into a .livecodescript file and then save it . . .
Easy enough to make one:
- -
BUT, how do you then reopen it to edit it?
Aaaaah: dead easy: so 'my problem' [phone a psychiatrist?] is not THAT, what it is is how to open a .livecodescript file from inwith the IDE and muck it about before saving it.
AND, just for added fun, one with a 'rev' prefix.
https://richmondmathewson.owlstown.net/
- tperry2x
- Posts: 2475
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Editing .livecodescript files
One livecodescript stack... "test_script.livecodescript" in this case.richmond62 wrote: ↑Thu Sep 21, 2023 11:44 am so 'my problem': ...how to open a .livecodescript file from inwith the IDE and muck it about before saving it.
You can open it like a normal stack, and it'll appear in the Application Browser You can then double click on the main stack "test_script" in this case, in the Application Browser and it'll pop open a window - it's not fully script only it turns out. (I think it's just set to hide it's main window on startup, otherwise seems exactly the same as a normal stack.
I can mess about with it after saving, closing, and reopening this way with the main window open via the Application Browser.
Now that, I have no idea about. Maybe open in an old copy of runtime revolution
Also, this shows how alert dialogs aren't savvy to the rest of the system theme.
- tperry2x
- Posts: 2475
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Editing .livecodescript files
Turns out it's blindingly simple: Create a new stack, with this button script in.
Click the button and locate your .rev script. You can then inspect and modify it with the Application Browser.
- tperry2x
- Posts: 2475
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Editing .livecodescript files
Turns out I can add a bit more to this:
After you open your stack, a list of all the window names is then popped into the message box, helping you track down the right window.- tperry2x
- Posts: 2475
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Editing .livecodescript files
... and if I really put some effort in, I might even create something half-usable:
- OpenXTalkPaul
- Posts: 2266
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Editing .livecodescript files
When a script only stack, which is just a text file, is opened in the IDE the engine creates a corresponding ephemeral Stack in memory, along with a card 1 of that stack, and if it starts with 'rev' it's invisible by default, except to the Application Overview & Project Browser stacks (or via script).You can then double click on the main stack "test_script" in this case, in the Application Browser and it'll pop open a window - it's not fully script only it turns out. (I think it's just set to hide it's main window on startup, otherwise seems exactly the same as a normal stack.
I often edit script-only (BTW, .oxtscript is also valid for OXT IDE, and is what I've been using for script-only filename extension) in Atom (VSCode, BBEdit,TextMate, or similar) coding text editor that has a LCS/LCB formatter package available to it. You could use built-in script editor, use shell(script), AppleScript, or built in 'launch' command to open it in external editor from within the IDE. If a stack is made the 'topStack' front window then I like to open the files from Finder on macOS. OXT (macOS Native Tools lib) has command I use from the message box:
Code: Select all
revealFileInFinder the filename of topStack
- richmond62
- Posts: 3896
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Editing .livecodescript files
I have demonstrated what can be done with this:
-
-
- Attachments
-
- scriptHacker.livecode.zip
- (217.11 KiB) Downloaded 401 times
https://richmondmathewson.owlstown.net/
- OpenXTalkPaul
- Posts: 2266
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Editing .livecodescript files
if you just want to edit a revWhatever library's script you can easily open it in the IDE's script editor using the Project Borwser's contextual menu.
- Attachments
-
- ProjectBrowserEditMenu.png (131.48 KiB) Viewed 7327 times
- richmond62
- Posts: 3896
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Editing .livecodescript files
I don't, I want to offer end-users of the IDE the option to set IDE colours, icons, and so on: ideally this sort of thing should be rolled into the Preferences stack.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 3896
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Editing .livecodescript files
One could, if one were very clever, extremely devoted, and motivated, write a stack which could do the whole 'shebang' and convert, say, LC 961 to OXT 'automagically'.
https://richmondmathewson.owlstown.net/
- OpenXTalkPaul
- Posts: 2266
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Editing .livecodescript files
This gives me a script error (relative path), should use special folder function or even better use the IDE library's functions that are included in the dictionary in OXT (search it for IDE and for rev).
But anyway I know you can edit script only files in memory, and then save them. Maybe I should reread this thread.
- OpenXTalkPaul
- Posts: 2266
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Editing .livecodescript files
revealFileInFinder revEnvironmentToolsetPath() &"/palettes/menubar/revmenubar.livecodescript"OpenXTalkPaul wrote: ↑Fri Sep 22, 2023 5:25 pmThis gives me a script error (relative path), should use special folder function or even better use the IDE library's functions that are included in the dictionary in OXT (search it for IDE and for rev).
But anyway I know you can edit script only files in memory, and then save them. Maybe I should reread this thread.
New Line 3 of 'Yellow" button:
put revEnvironmentToolsetPath() &"/palettes/menubar/revmenubar.livecodescript" into PATEKA
- OpenXTalkPaul
- Posts: 2266
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Editing .livecodescript files
WTF, I hope I have a backup, lol(!?!) JK, I do. This replaced my OXT version revMenuBar entirely?OpenXTalkPaul wrote: ↑Fri Sep 22, 2023 5:29 pmrevealFileInFinder revEnvironmentToolsetPath() &"/palettes/menubar/revmenubar.livecodescript"OpenXTalkPaul wrote: ↑Fri Sep 22, 2023 5:25 pmThis gives me a script error (relative path), should use special folder function or even better use the IDE library's functions that are included in the dictionary in OXT (search it for IDE and for rev).
But anyway I know you can edit script only files in memory, and then save them. Maybe I should reread this thread.
New Line 3 of 'Yellow" button:
put revEnvironmentToolsetPath() &"/palettes/menubar/revmenubar.livecodescript" into PATEKA
- Attachments
-
- Uhg!.png (84.87 KiB) Viewed 7316 times
- richmond62
- Posts: 3896
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Editing .livecodescript files
Had you examined the stack carefully and the script in the Yellow button you would have found that the WHOLE script stack is replaced.WTF
https://richmondmathewson.owlstown.net/
- tperry2x
- Posts: 2475
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Editing .livecodescript files
Unfortunately this approach of replacing stacks won't work on Linux and Windows (I've just discovered) as a normal user does not have the necessary permissions.richmond62 wrote: ↑Fri Sep 22, 2023 5:55 pm ...the script in the Yellow button ... the WHOLE script stack is replaced.
It would be better if it could be made to read a config file stored in the users home /openxtalk folder.
Progress on Windows is slow, btw. Hampered by the fact that windows does not handle folder names that begin with a . which is a bit
- OpenXTalkPaul
- Posts: 2266
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: Editing .livecodescript files
I didn't, was too busy making it actually work, but not a big deal. It would be better if a script that does stuff like that would give a basic warning, and/or make a backup copy of the file being replaced.richmond62 wrote: ↑Fri Sep 22, 2023 5:55 pmHad you examined the stack carefully and the script in the Yellow button you would have found that the WHOLE script stack is replaced.WTF
Anyway, the yellow background looking bad in darkMode aside, I kind of like having that menubar-Toolbar as a floating window that can be minimized, macOS is the only platform where it's normally not that way. It would be good to make that an optional preference.
- richmond62
- Posts: 3896
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Editing .livecodescript files
I am sorry if I offended your aesthetic sensibilities: that was NOT my intention.
What I was trying to do was work out a way to have scripts for, say, the revPreferences stack, that could open up a far larger amount of customisation that LC permits, and as such, I was working with LC 961 rather than anyone's OXT offering.
In a perfect world [Ho, Ho, Ho] the revPreference stack would offer:
Dark mode
Light mode
LGBT mode
Lemon yellow with flying ducks mode
Barister mode [coffee]
Heavy Metal mode [now, a sort of Steam Punk one would be rather fun]
Floating MenuBar [preferably palettised like the Tools]
Vertical MenuBar
Horizontal Tools
And so on, and on, and on: probably also a colour wheel so that folk could really pimp their interface stacks to whatever they wanted ['Dog's Vomit mode'].
7 or 8 colourisation schemes for the scriptEditor
Combined MenBar & Tools in one palette
Icon choice for the Application Browser and the Project Browser.
Choice of icons (or none) for the answer and ask dialogues.
Better stop this and go to bed as have to teach 'tinies' EFL [English as a FFFFFFFed Language] tomorrow, and, among other things explain why I don't care at all if they use GB English, US English, Canadian English, or whatever: as they have silly 'English' teachers at school [who cannot understand the differences between the dialects] who insists that they stick to 'British English', but then tell them that they should spell 'Mum' 'Mom'.
What I was trying to do was work out a way to have scripts for, say, the revPreferences stack, that could open up a far larger amount of customisation that LC permits, and as such, I was working with LC 961 rather than anyone's OXT offering.
Yes, it would, as, having the MenuBar 'jammed' up in the top-lefthand corner of the screen is not always what one wants.I kind of like having that menubar-Toolbar as a floating window that can be minimized, macOS is the only platform where it's normally not that way. It would be good to make that an optional preference.
In a perfect world [Ho, Ho, Ho] the revPreference stack would offer:
Dark mode
Light mode
LGBT mode
Lemon yellow with flying ducks mode
Barister mode [coffee]
Heavy Metal mode [now, a sort of Steam Punk one would be rather fun]
Floating MenuBar [preferably palettised like the Tools]
Vertical MenuBar
Horizontal Tools
And so on, and on, and on: probably also a colour wheel so that folk could really pimp their interface stacks to whatever they wanted ['Dog's Vomit mode'].
7 or 8 colourisation schemes for the scriptEditor
Combined MenBar & Tools in one palette
Icon choice for the Application Browser and the Project Browser.
Choice of icons (or none) for the answer and ask dialogues.
Better stop this and go to bed as have to teach 'tinies' EFL [English as a FFFFFFFed Language] tomorrow, and, among other things explain why I don't care at all if they use GB English, US English, Canadian English, or whatever: as they have silly 'English' teachers at school [who cannot understand the differences between the dialects] who insists that they stick to 'British English', but then tell them that they should spell 'Mum' 'Mom'.
https://richmondmathewson.owlstown.net/
Who is online
Users browsing this forum: No registered users and 1 guest