Page 20 of 28
Re: Minor scripting related wishes (a generic thread)
Posted: 19 Dec 2014 06:19
by bdeshi
could you add favorite lists to get() ?
eg:
Code: Select all
"list_favorites", [separator=CRLF], [flags]
[separator]: String to place between items. Defaults to CRLF (line feed).
flags: Defaults to "dfo".
d = Return folders.
f = Return files.
o = Return other types of favs.
return: List of favorite items.
Re: Minor scripting related wishes (a generic thread)
Posted: 19 Dec 2014 13:56
by klownboy
+1 We've pulled the Favorites Files and Folders a number of times in various scripts, like
CleanRecent using getkey, but this would make it much easier and we'd be assured they're up-to-date.
Re: Minor scripting related wishes (a generic thread)
Posted: 19 Dec 2014 14:59
by highend
Can you add one more data parameter to tab("get", ...) please?
"home": path to the home zone / location
Afaik there is no easy way (apart from saving the whole tabset and read out the home location from the pane.ini file afterwards) to get this path.
This would make scripts like
http://www.xyplorer.com/xyfc/viewtopic.php?f=7&t=8633 much smaller & cleaner (apart from unnecessary writes on ssd drives).
This is the missing piece to get all necessary information from a tab (apart from the icon, but this is just one additional line of scripting)!
Re: Minor scripting related wishes (a generic thread)
Posted: 13 Jan 2015 19:44
by bdeshi
can sc html() become stronger and support returning POST returns ?
Submitting a POST form will need to close the html dlg.
Perhaps the dlg "close" btn could be tied to submitting a form...
Re: Minor scripting related wishes (a generic thread)
Posted: 11 Feb 2015 21:35
by TheQwerty
Some dereferenced variable wishes...
- The unset SC should have the smarts to correctly handle unsetting a dereferenced variable even if it is supplied in an argument after the variable holding the name.
Code: Select all
$var = '$a'; *$var = 'test';
Unset *$var, $var; // Works correctly.
$var = '$a'; *$var = 'test';
Unset $var, *$var; // Leaves $a.
- The IsSet SC doesn't seem to understand the dereference operator. This can be worked around by testing if the dereferenced value is the variable names, but that's not 100% accurate. In the following demo IsSet(*$var) should be the same as IsSet($a):
Code: Select all
"Demo"
$a_IsSetA = IsSet($a);
$a_IsSetVar = IsSet($var);
$a_IsSetDVar = IsSet(*$var);
$a_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$a_WA = $a_IsSetA == $a_ValEqStr;
$var = '$a';
$b_IsSetA = IsSet($a);
$b_IsSetVar = IsSet($var);
$b_IsSetDVar = IsSet(*$var);
$b_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$b_WA = $b_IsSetA == $b_ValEqStr;
*$var = 'value';
$c_IsSetA = IsSet($a);
$c_IsSetVar = IsSet($var);
$c_IsSetDVar = IsSet(*$var);
$c_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$c_WA = $c_IsSetA == $c_ValEqStr;
$a = 'try again';
$d_IsSetA = IsSet($a);
$d_IsSetVar = IsSet($var);
$d_IsSetDVar = IsSet(*$var);
$d_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$d_WA = $d_IsSetA == $d_ValEqStr;
$a = '$a';
$e_IsSetA = IsSet($a);
$e_IsSetVar = IsSet($var);
$e_IsSetDVar = IsSet(*$var);
$e_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$e_WA = $e_IsSetA == $e_ValEqStr;
unset $var, $a;
Text <<<RESULTS
IsSet($a) - IsSet($var) - IsSet(*$var) - (*$var) != '*$var' && (*$var) != $var - Workaround Works?
Before $var is set: $a_IsSetA - $a_IsSetVar - $a_IsSetDVar - $a_ValEqStr - $a_WA
After $var = '$a': $b_IsSetA - $b_IsSetVar - $b_IsSetDVar - $b_ValEqStr - $b_WA
After *$var = 'value': $c_IsSetA - $c_IsSetVar - $c_IsSetDVar - $c_ValEqStr - $c_WA
After $a = 'try again': $d_IsSetA - $d_IsSetVar - $d_IsSetDVar - $d_ValEqStr - $d_WA
After $a = '$a': $e_IsSetA - $e_IsSetVar - $e_IsSetDVar - $e_ValEqStr - $e_WA
RESULTS
, 800;
[/size]
Re: Minor scripting related wishes (a generic thread)
Posted: 27 Feb 2015 18:49
by zer0
I would like for
folderreport's classic directory dump to be enhanced to show individual and total quantity of files of child folders in the listing of details of the parent folder. Having to look and add things up for individual folders is actually quite a drag. Thank you in advance!

Re: Minor scripting related wishes (a generic thread)
Posted: 05 Mar 2015 17:28
by admin
TheQwerty wrote:Some dereferenced variable wishes...
- The unset SC should have the smarts to correctly handle unsetting a dereferenced variable even if it is supplied in an argument after the variable holding the name.
Code: Select all
$var = '$a'; *$var = 'test';
Unset *$var, $var; // Works correctly.
$var = '$a'; *$var = 'test';
Unset $var, *$var; // Leaves $a.
- The IsSet SC doesn't seem to understand the dereference operator. This can be worked around by testing if the dereferenced value is the variable names, but that's not 100% accurate. In the following demo IsSet(*$var) should be the same as IsSet($a):
Code: Select all
"Demo"
$a_IsSetA = IsSet($a);
$a_IsSetVar = IsSet($var);
$a_IsSetDVar = IsSet(*$var);
$a_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$a_WA = $a_IsSetA == $a_ValEqStr;
$var = '$a';
$b_IsSetA = IsSet($a);
$b_IsSetVar = IsSet($var);
$b_IsSetDVar = IsSet(*$var);
$b_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$b_WA = $b_IsSetA == $b_ValEqStr;
*$var = 'value';
$c_IsSetA = IsSet($a);
$c_IsSetVar = IsSet($var);
$c_IsSetDVar = IsSet(*$var);
$c_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$c_WA = $c_IsSetA == $c_ValEqStr;
$a = 'try again';
$d_IsSetA = IsSet($a);
$d_IsSetVar = IsSet($var);
$d_IsSetDVar = IsSet(*$var);
$d_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$d_WA = $d_IsSetA == $d_ValEqStr;
$a = '$a';
$e_IsSetA = IsSet($a);
$e_IsSetVar = IsSet($var);
$e_IsSetDVar = IsSet(*$var);
$e_ValEqStr = (*$var) != '*$var' && (*$var) != $var;
$e_WA = $e_IsSetA == $e_ValEqStr;
unset $var, $a;
Text <<<RESULTS
IsSet($a) - IsSet($var) - IsSet(*$var) - (*$var) != '*$var' && (*$var) != $var - Workaround Works?
Before $var is set: $a_IsSetA - $a_IsSetVar - $a_IsSetDVar - $a_ValEqStr - $a_WA
After $var = '$a': $b_IsSetA - $b_IsSetVar - $b_IsSetDVar - $b_ValEqStr - $b_WA
After *$var = 'value': $c_IsSetA - $c_IsSetVar - $c_IsSetDVar - $c_ValEqStr - $c_WA
After $a = 'try again': $d_IsSetA - $d_IsSetVar - $d_IsSetDVar - $d_ValEqStr - $d_WA
After $a = '$a': $e_IsSetA - $e_IsSetVar - $e_IsSetDVar - $e_ValEqStr - $e_WA
RESULTS
, 800;
[/size]
1. Not possible. Or do you mean by smartness that XY should reorder the arguments?
2. Confirmed and fixed.
Re: Minor scripting related wishes (a generic thread)
Posted: 05 Mar 2015 17:46
by TheQwerty
admin wrote:TheQwerty wrote:
- The unset SC should have the smarts to correctly handle unsetting a dereferenced variable even if it is supplied in an argument after the variable holding the name.
Code: Select all
$var = '$a'; *$var = 'test';
Unset *$var, $var; // Works correctly.
$var = '$a'; *$var = 'test';
Unset $var, *$var; // Leaves $a.
1. Not possible. Or do you mean by smartness that XY should reorder the arguments?
2. Confirmed and fixed.
1.

The user shouldn't have to think about the order of the arguments they pass to unset. XY should detect and unset any dereferenced variable arguments (*$var) first, then unset the rest of the variables. If you want to think of it as reordering the arguments upon receiving them okay.
2. Sweet - thanks!

Re: Minor scripting related wishes (a generic thread)
Posted: 05 Mar 2015 19:05
by admin
1. OK.

Re: Minor scripting related wishes (a generic thread)
Posted: 06 Mar 2015 17:42
by bdeshi
either add a reload operation to tabset() or make "load" reload passed tabset from disk if it's current.
ATM "load"ing a current tabset just statuses "tabset already opened". This disrupts updating loaded tabset with manual modifications to it's ini.
Re: Minor scripting related wishes (a generic thread)
Posted: 09 Mar 2015 14:31
by TheQwerty
I hope to one-day see this in the change log:
Code: Select all
* SC Load: Now the labels argument also supports CRLF-separated lists of labels.
Reasoning:
- ;-separated lists in code are ugly.
- ;-separated lists make it difficult to visualize the generated menu.
- HEREDOCs can be used to generate CRLF-separated lists.
Code: Select all
"Show Menu (Ugly)"
$menu = '_favs;_favFiles;_favsFull;-;_drives;_drivesSpecial;-;_tabsAll;_tabsPane';
Load '*', $menu;
"Show Menu (Less Ugly)"
$menu = <<<MENU
_favs
_favFiles
_favsFull
-
_drives
_drivesSpecial
-
_tabsAll
_tabsPane
MENU;
Load '*', Replace($menu, <crlf>, ';');
"Show Menu (Nice)"
Load '*', <<<MENU
_favs
_favFiles
_favsFull
-
_drives
_drivesSpecial
-
_tabsAll
_tabsPane
MENU;
Re: Minor scripting related wishes (a generic thread)
Posted: 16 Mar 2015 16:15
by admin
OK, and thanks for the change log text.

Re: Minor scripting related wishes (a generic thread)
Posted: 16 Mar 2015 16:22
by admin
SammaySarkar wrote:either add a reload operation to tabset() or make "load" reload passed tabset from disk if it's current.
ATM "load"ing a current tabset just statuses "tabset already opened". This disrupts updating loaded tabset with manual modifications to it's ini.
Why not use "revert? Help:
"revert" Revert the current tabset to its saved state.
Re: Minor scripting related wishes (a generic thread)
Posted: 17 Mar 2015 04:03
by bdeshi
OK.

Re: Minor scripting related wishes (a generic thread)
Posted: 18 Mar 2015 15:36
by TheQwerty
On the edge of being a bug -
timestamp's
type and
source_type arguments are case-sensitive and unfortunately the SC gives the impression that it works even though it doesn't when those arguments are capitalized.
Demo:
Code: Select all
"Timestamp Case Sensitivity"
$item = New("%temp%\<date yyyy-mm-dd_hhnnss>.txt", 'f',, 'u');
$property = '#date.modified';
$original = Property($property, $item);
timestamp 'm', '1990-01-01 1:00', $item;
$lowerCase = Property($property, $item);
timestamp 'M', '2000-02-02 2:00', $item;
$upperCase = Property($property, $item);
Echo <<<MESSAGE
File: '$item'
Modified date:
Original = $original
timestamp 'm', '1990-01-01 1:00': $lowerCase (Correct.)
timestamp 'M', '2000-02-02 2:00': $upperCase (Incorrect!)
MESSAGE;
delete 1,, $item;
Change-log message ready to be copied and pasted after issue is resolved.

Code: Select all
* SC timestamp: Now the type and source_type arguments are case-insensitive.