Page 1 of 1

[SC]: Load custom layout

Posted: 11 May 2014 17:09
by binocular222
Something like:

Code: Select all

Layout("<xydata>\Columns\mylayout.txt", "load")

Re: [SC]: Load custom layout

Posted: 11 May 2014 18:20
by admin
Yes, good idea.

Re: [SC]: Load custom layout

Posted: 12 May 2014 03:54
by binocular222
Just have a second thought.
Layout would be a bad name as it refer to position of Address Bar, Toolbar.
Combine into setcolumns("<xydata>\Columns\mylayout.txt", "flag=load") would make sense

Re: [SC]: Load custom layout

Posted: 12 May 2014 08:56
by admin
Too late. Haven't you seen that I already added it?

Code: Select all

v14.00.0113 - 2014-05-11 20:52
    + Scripting got a new function.
      Name: ColumnLayout
      Action: Loads or saves a column layout.
      Syntax: columnlayout(file, [mode="load"])
        file:     File to save the column layout to, or to load it from.
                  Either full path or resolved relative to <xydata>\Columns\.
                  If missing you are prompted by a standard Windows dialog.
                  If no extension is passed the extension defaults to ".txt".
        mode:
          load = [Default] load columns from file
          save = save columns to file
        return:   The column loaded or saved.
      Examples:
        columnlayout("default"); //loads columns from <xydata>\Columns\Default.txt
        columnlayout("default", "save"); //saves columns to <xydata>\Columns\Default.txt
        columnlayout(); //loads columns, file is prompted
        columnlayout(, "save"); //saves columns, file is prompted

Re: [SC]: Load custom layout

Posted: 12 May 2014 15:18
by admin
BTW, I added this simple script in a Catalog Item called "Column Layout". It allows me to quickly load a Column Layout from all Column Layouts I have saved so far:

Code: Select all

$cs = listfolder("<xydata>\Columns", "*.txt", 5);
  $cs = replace($cs, ".txt", "");
  $c = popupmenu($cs);
  if ($c) {columnlayout($c)};

Re: [SC]: Load custom layout

Posted: 15 May 2014 09:52
by FluxTorpedoe
Hi'
I just upgraded from v14 to v14.00.0116 — to see if there was a hidden MakeAlien( :bug: ) command… :mrgreen:
So sorry if I'm a little late with my question about Column Layouts (Menu and SC).

First I must stress that I'm a big fan of these features (an old wish if you recall ;) ).

That being said, I'm a bit surprised by the complete removal of the old "no-questions-asked" default layout management via Menu and #377.
I can understand that the previous Menu may have been confusing to some, but as powerful as the new Menu and SC are, they miss the straightforward access of #377 (with "transparent" loading for List and Search) — or am I missing something?

• "Default Column Layouts" and "Custom Column Layouts" are complementary, so could'nt they still coexist?
Via, e.g. (if you don't want to keep the old "Save/Load Column Layout"):
columnlayout() // No arguments = Load default (previous "Load Saved Column Layout")
columnlayout( , "save") // No file arguments = Save default (previous "Save Column Layout")
And their corresponding quick commands (the old #377 and #378).

• Bonus Wish
While we're at it, this would be great too: :wink:
columnlayout(file, [mode="load"], [type="file|value"])

Code: Select all

$Col = "Path.150,+Name.180";
columnlayout($Col, "save", "v");
columnlayout($Col, , "v");
Have a nice day & Thanks for your attention, 8)
Flux

Re: [SC]: Load custom layout

Posted: 15 May 2014 11:32
by admin
Too much trouble over the years so I wanted to get rid of them. :)

Bonus wish: SetColumns is the command for this job.

Re: [SC]: Load custom layout

Posted: 15 May 2014 15:11
by FluxTorpedoe
admin wrote:Too much trouble over the years so I wanted to get rid of them.
Well, that's kind of a valid argument… ;)
I'll update my scripts then!

As for the SetColumns, of course!…
Which leads me to a related question: since it's possible to autosize specific columns, could there be way to store that in the full Columns info?
e.g. with a "?" after the dot instead of a number:
setcolumns("+Path.140,+Name.?,+Size.?", 3);

Re: [SC]: Load custom layout

Posted: 15 May 2014 15:31
by admin
Interesting idea! Maybe something for later...

Re: [SC]: Load custom layout

Posted: 16 May 2014 15:28
by FluxTorpedoe
Cool!
:)