Page 1 of 1
Compeare loaded PaperFolder with its actual file?
Posted: 03 Jan 2024 23:33
by eil
I like to keep my PaperFolders in Explicit Save mode. But sometimes this leads to little inconvenience, like say i add some items, switch to other app doing stuff, and then back to XY, switching tab and losing those items, 'cause i forgot i didn't make manual save. Not a big deal and as i understand i can add some smartness with CEA on tabs switch, checking if tab is a PF. But how can i compare loaded PF tab and the actual PF file, to get to know tab's list was modified but not saved?
Re: Compeare loaded PaperFolder with its actual file?
Posted: 04 Jan 2024 00:35
by highend
If the current pane content is not 100% identical to it's pf?
Code: Select all
if (strpos(tab("get", "name"), "paper:") == -1) { end true; }
if (listpane(, , , <crlf>) != paperfolder(, , , "r")) {
// Different, do whatever you want to do...
}
If the pane content is just sorted differently this should be sufficient as well:
Code: Select all
if (strpos(tab("get", "name"), "paper:") == -1) { end true; }
if (strlen(listpane(, , , <crlf>)) != strlen(paperfolder(, , , "r"))) {
// Different, do whatever you want to do...
}
Re: Compeare loaded PaperFolder with its actual file?
Posted: 04 Jan 2024 18:57
by eil
highend thank you for code examples. For pity seem like my idea won't work, as while trying codes i understood CEA Tabs Switch makes action After one gets to another tab,
If Don reads this = how about another CEA for making action Before switching to another tab?(so one soe actions can happen in current tab and only then switch to newly selected happens)