@all
The new v4 final is coming soon, with a nice bonus: you’ll be able to add icons to sessions! Plus the session list is now more readable…
---------------------------
@SkyFrontier and…
whoever feels twisted enough
Here’s a working proof of concept of "
Snap Sessions", to see how it could be integrated (and whether it should be). I know it’s not exactly what you asked, but it’s a first step…
• Snap Sessions only contain the paths of all tabs on both panes, and are stored as single entries in an INI file.
• They’re very light on resources but lack the extra info of regular sessions/tabsets (folder view settings,…)
•
What it does:
— via UDC, automatically saves auto-named sessions (under a Date+ActivePath name)
Note: the UDC auto-saving of auto-named “real” sessions could very easily be integrated in SM
— lists all available Snap Sessions: list can easily be integrated in SM / replace regular sessions list if needed
— load Snap Session: very fast (by creating "real-fake" tabsets – faster than loading each tab)
•
What it doesn’t/won’t do:
— time-based autosaving: not possible internally from XY (but UDC could be activated via AHK)
— guessing the user’s need: hmmm still trying to figure this one out…
• In the end, since I don’t have this kind of needs right now, I’ve a hard time figuring out whether it can already be useful or interesting, and/or how it could or should evolve…
So you tell me!…
Have a nice day,
Flux
---------------------------
• Right now, with the script saved as "SessionManager-Snaps.xys", it can be run via:
::load "SessionManager-Snaps.xys", "_SnapSave"
No confirmation. Adds a Snap Session entry in a "SessionManager-Snaps.ini".
::load "SessionManager-Snaps.xys", "_SnapLoad"
Opens the Snap Session list. Loading a session will use dummy tabsets so no risk to lose your real tabsets or sessions.
Code: Select all
/* ######################################################################################### */
/* ######################################################################################### */
"_SnapSave"
$GEN_INI = "<xyscripts>\SessionManager-Snaps.ini";
set $l_tabs;
// ------------------------------<> Define name of Snap Session from date and active path
$SnapName = gettoken(tab("get", "data"), -1, "\");
$d_Ellips = (strlen($SnapName) > 30)? "…" : "";
$SnapName = <date yymmdd_hhnnss>." - “".substr(tab("get", "path"), 0, 1).":>…\".substr($SnapName, 0, 30).$d_Ellips."”";
focus "P1";
// --------------------------------------------------------->> Process each pane
while ($i++ < 2) {
// ---------------------------------------------> Save each tab
while ($j++ < tab("get", "count")) {
$l_tabs = $l_tabs.tab("get", "data", $j)."|";
}
// ---------------------------------------------<
$l_tabs = trim($l_tabs, "|")."¶";
focus "P2";
set $j;
}
// ---------------------------------------------------------<<
// ------------------------------<> Store Snap Session in INI file as: Date=Name¶Pane1Tabs¶Pane2Tabs
setkey $SnapName."¶".trim($l_tabs, "|"), <date yymmdd_hhnnss>, "Snaps", $GEN_INI;
/* ######################################################################################### */
/* ######################################################################################### */
"_SnapLoad"
$GEN_INI = "<xyscripts>\SessionManager-Snaps.ini";
$l_Snaps = trim(replace(getkey( , "Snaps", $GEN_INI), chr(0), "|"), "|");
set $input;
foreach ($Snap, $l_Snaps) {
$input = $input."|".gettoken(getkey($Snap, "Snaps", $GEN_INI), 1, "¶");
}
$input = inputselect("Select Snap Session to open", trim($input, "|"), , 8, , 400, 650, "Snap Sessions");
$l_tabs = getkey(gettoken($input, 1), "Snaps", $GEN_INI);
// --------------------------------------------------------->> Process each pane
while($i++ < 2) {
tabset("saveas", "§0§_TMP_".$i, $i); // Temporary tabset to avoid risk of 1. ruining real sessions, 2. name collision
$l_tabsinpane = gettoken($l_tabs, 1+$i, "¶");
// ---------------------------------------------> Build fake pane.ini
$pane_ini = "[Tabs]<crlf>Count=".gettoken($l_tabsinpane, "count", "|")."<crlf>";
foreach($tab, $l_tabsinpane) {
$pane_ini = $pane_ini."D".$j++."=".$tab."<crlf>";
}
writefile("<xydata>\Panes\§0§_".$i."\pane.ini", $pane_ini);
// ---------------------------------------------<
tabset("load", "§0§_".$i, $i);
set $j;
}
// ---------------------------------------------------------<<
delete 1, 0, "<xydata>\Panes\§0§_*";
[/size]