Code window improvements
Moderator: Klaus
Code window improvements
For me, two of the most frustrating features of the LC code window are (1) that the recent history of script tabs is not saved when one quits and relaunches LC, and (2) that there is no split-screen feature that, for example, enables one to view script variables declared at the top of the script while employing these a hundred lines down the code.
Seems to me that each of these improvements could be implemented without much trouble.
(1) I make a working copy of my LC file after each major edit, so that I can I can revert back in case I've screwed up. However, that copy does not include a history of the scripts that I'd had open for editing. Consequently, I've got to figure out from scratch which scripts I'd had opened for editing. It would be great if LC saved and restored the history of recently displayed scripts, just as some apps track recently opened files.
(2) I've been employing script-local variables as an alternative to the global variables disparaged in the LC documentation. However, when a script runs a few hundred lines, it is extremely inconvenient to scroll up and down between the declared script variables and the handlers invoking those variables. Life would be much simpler if LC implemented a split-screen -- much like many word-processing apps -- so that we could display these declarations at the top of the script window and still display the script currently being constructed below.
I hope that the LC developers will address these issues.
jeff k
Seems to me that each of these improvements could be implemented without much trouble.
(1) I make a working copy of my LC file after each major edit, so that I can I can revert back in case I've screwed up. However, that copy does not include a history of the scripts that I'd had open for editing. Consequently, I've got to figure out from scratch which scripts I'd had opened for editing. It would be great if LC saved and restored the history of recently displayed scripts, just as some apps track recently opened files.
(2) I've been employing script-local variables as an alternative to the global variables disparaged in the LC documentation. However, when a script runs a few hundred lines, it is extremely inconvenient to scroll up and down between the declared script variables and the handlers invoking those variables. Life would be much simpler if LC implemented a split-screen -- much like many word-processing apps -- so that we could display these declarations at the top of the script window and still display the script currently being constructed below.
I hope that the LC developers will address these issues.
jeff k
-
- Posts: 738
- Joined: Thu Sep 11, 2014 1:49 pm
Re: Code window improvements
I had the same issues and at one time almost lost a huge amount of work.
My current solution is a free Windows only application called Cobian Backup http://www.cobiansoft.com/index.htm.
This application is able to copy a changed file in a folder (stack) every x minutes to a backup location.
Now I can always refer back to any previous version of my stack in increments of x minutes back in time
For me at this moment it is sufficient and it has saved my bacon on several occasions.
Maybe this is a solution for you as well.
Regards,
Paul
My current solution is a free Windows only application called Cobian Backup http://www.cobiansoft.com/index.htm.
This application is able to copy a changed file in a folder (stack) every x minutes to a backup location.
Now I can always refer back to any previous version of my stack in increments of x minutes back in time

For me at this moment it is sufficient and it has saved my bacon on several occasions.
Maybe this is a solution for you as well.
Regards,
Paul
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Code window improvements
I've found Nextcloud a game-changer:
https://nextcloud.com/
It updates and syncs folders across any number of machines. I use it to sync my LiveCode Plugins folder and work folders - everything stays current, and I have one more backup.
Nextcloud does a lot more besides (they have a large and growing number of third-party apps), all free and open and unlike pubic clouds it's completely under your control.
https://nextcloud.com/
It updates and syncs folders across any number of machines. I use it to sync my LiveCode Plugins folder and work folders - everything stays current, and I have one more backup.
Nextcloud does a lot more besides (they have a large and growing number of third-party apps), all free and open and unlike pubic clouds it's completely under your control.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Code window improvements
Thanks much to Paul and Richard for your replies.
However, as best I can tell, the suggestions offered do not address the issue I'd raised regarding saving a record of recent scripts (tabs) in the Code window.
As long as one does not quit LC, the "Recent Scripts" (clock-like icon) button in the Code window menubar retains a list of (at least) the 14 most recent scripts opened.
However, that list is *not* saved and restored when one quits and reopens the main stack in LC -- whether the original or a backup copy.
The feature that I'm requesting is simply that LC save this list of recently opened scripts to some kind of preferences or application support file, so that when it is reopened (or copied) this list of recently opened scripts is still available.
Currently, before I save and close a LC file, I've got to jot down on paper all open tabs in the Code window, just so I know which scripts I need to open again to continue editing once I reopen that LC file.
jeff k
However, as best I can tell, the suggestions offered do not address the issue I'd raised regarding saving a record of recent scripts (tabs) in the Code window.
As long as one does not quit LC, the "Recent Scripts" (clock-like icon) button in the Code window menubar retains a list of (at least) the 14 most recent scripts opened.
However, that list is *not* saved and restored when one quits and reopens the main stack in LC -- whether the original or a backup copy.
The feature that I'm requesting is simply that LC save this list of recently opened scripts to some kind of preferences or application support file, so that when it is reopened (or copied) this list of recently opened scripts is still available.
Currently, before I save and close a LC file, I've got to jot down on paper all open tabs in the Code window, just so I know which scripts I need to open again to continue editing once I reopen that LC file.
jeff k
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Code window improvements
Cobian Backup and so on are effective for keeping backups.
However it is entirely possible to get that sort of thing going in LiveCode itself (I've done it twice but cannot lay my hands on the stacks).
AND, NO, it doesn't help with a request for a record of recent scripts in the code window.
I think this may be problematic as the code window (aka scriptEditor) is NOT part of the stack being edited.
Were the code window part of the stack being edited it could save records of recent scripts within the relevant stack.
HOWEVER if your stack were saving recensions of scripts within itself say every 15 seconds it would soon be
bloated beyond belief.
However it is entirely possible to get that sort of thing going in LiveCode itself (I've done it twice but cannot lay my hands on the stacks).
AND, NO, it doesn't help with a request for a record of recent scripts in the code window.
I think this may be problematic as the code window (aka scriptEditor) is NOT part of the stack being edited.
Were the code window part of the stack being edited it could save records of recent scripts within the relevant stack.
HOWEVER if your stack were saving recensions of scripts within itself say every 15 seconds it would soon be
bloated beyond belief.
-
- Livecode Opensource Backer
- Posts: 10080
- Joined: Fri Feb 19, 2010 10:17 am
Re: Code window improvements
Ah: Gottit:
http://forums.livecode.com/viewtopic.ph ... ol#p146670
The Dropbox location is still valid.
http://forums.livecode.com/viewtopic.ph ... ol#p146670
The Dropbox location is still valid.
Re: Code window improvements
This really shouldn't be too difficult to implement..jmk_phd wrote:The feature that I'm requesting is simply that LC save this list of recently opened scripts to some kind of preferences or application support file, so that when it is reopened (or copied) this list of recently opened scripts is still available.
Re: Code window improvements
Spent a few minutes on this and here is what you would need to do (this may or may not work and/or break the IDE, but should be fine).. The only thing I didn't bother working on was figuring what Script Editor window is in use, so you can do that.. In all the sample code below you will need to replace the # symbol with the actual number associated with the script editor window (if you have one script editor window open, it'll probably be 1)..
To get the history:
To get the history to load, you'll need to a custom property, on the revPreferences stack (which is where they save the history anyways), and then force the history to be loaded..
To get the history:
Code: Select all
put value("seHistoryGet()", stack "revNewScriptEditor #") into aVariable
Code: Select all
set the cScriptEditorHistory of stack "revPreferences" to aVariableContainingYourHistory
send "seHistoryLoad" to stack "revNewScriptEditor #"
Re: Code window improvements
I know this isn't the solution to your request, but for future reference, LC ships with an auto-save plugin. Look in the Plugins menu. You can set the save interval to the number of minutes between saves.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: Code window improvements
You can also look at overloading the Save and duplicate the stack before saving the changes..
Re: Code window improvements
Thanks again to everyone who contributed solutions to the minor annoyance that the history of opened scripts is lost when one duplicates an LC mainstack file in the Mac Finder (and presumably in whatever is the Windows equivalent).
The suggestion to do instead a "Save as..." from the LC menu -- saving the mainstack file to a newly-created folder/directory under a different name -- does indeed retain in that copy the history of recently-opened scripts (in the dropdown menu in the upper right corner of the code-editing window). This is indeed a better (and less tedious) alternative to jotting down a list of recently-opened scripts and having to reopen each one manually via the Project browser.
Not for the first time, I'm deeply indebted again to your generous support.
jeff k
The suggestion to do instead a "Save as..." from the LC menu -- saving the mainstack file to a newly-created folder/directory under a different name -- does indeed retain in that copy the history of recently-opened scripts (in the dropdown menu in the upper right corner of the code-editing window). This is indeed a better (and less tedious) alternative to jotting down a list of recently-opened scripts and having to reopen each one manually via the Project browser.
Not for the first time, I'm deeply indebted again to your generous support.
jeff k