Minor scripting related wishes (a generic thread)

Features wanted...
klownboy
Posts: 4148
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

Actually that may be a very good idea, in that we could potentially use that for many situations when a property name / index is different across Windows systems. I assume then we could use get("propertyindex", columnheader) to arrive at the local system index, assign it to a variable, and then use the variable in the script to perform the desired operation. That could end up being very useful in other situations when a scripter wants to use property or report in a script. I have another script that cropped photos in various aspect ratios that I realized wasn't working on my Windows 8 machine for this vary reason.

Thanks again Don,
Ken
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

Ok. :)

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

klownboy wrote:Actually that may be a very good idea, in that we could potentially use that for many situations when a property name / index is different across Windows systems. I assume then we could use get("propertyindex", columnheader) to arrive at the local system index, assign it to a variable, and then use the variable in the script to perform the desired operation. That could end up being very useful in other situations when a scripter wants to use property or report in a script. I have another script that cropped photos in various aspect ratios that I realized wasn't working on my Windows 8 machine for this vary reason.

Thanks again Don,
Ken
It's probably too late but can I suggest instead of 'PropertyIndex' you make it 'PropertyLookup' and instead of 'columnheader' you match Property()'s property argument?

This way if the name of a property is supplied it returns the index.
If an index is supplied it returns the property name.
If omitted it returns a list or properties in a format similar to:

Code: Select all

#1=Name
#2=Name
...
#N=Name
Maybe even add another option to force it to return/use the name from a specific language?



Unless the Get('PropertyIndex','columnheader'); only accepts properties' English names, I fail to see how this is going to help with the case of 'Orientation' being 'Ausrichtung' in German. It would only allow identifying the index of a property with the same name on two installs of an OS in the same language, but since the Property() SC can use the property name nothing is really gained. Or am I missing something? :veryconfused:

EDIT: Too late by a matter of minutes. :(

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

Yeah, too late.

Well, if "Orientation" exists in Vista, Win7, and Win8, you can now write a script that would work in all three OS, as long as they are in the same language. I know it's a small step and the topic is totally depressing. So let's leave at that and move on to brighter shores...

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

admin wrote:Yeah, too late.

Well, if "Orientation" exists in Vista, Win7, and Win8, you can now write a script that would work in all three OS, as long as they are in the same language. I know it's a small step and the topic is totally depressing. So let's leave at that and move on to brighter shores...
But you could do that before by just using "Orientation" rather than whatever index it is assigned. :P

How about instead of that complicated stuff I just suggested add Get('PropertyList'); which returns a list of property indexes and their localized names?

Code: Select all

#0=Name
#1=Size
#2=Item type
...
#N=Awesomeness
This way the cross-language part can be solved by asking a user to identify which property corresponds to whatever property we actually want.


Along the same lines maybe the Property() SC could support using '*' for the property argument to return a list of all of the properties for the specified item in a format like the above but including their values?

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

TheQwerty wrote:
admin wrote:Yeah, too late.

Well, if "Orientation" exists in Vista, Win7, and Win8, you can now write a script that would work in all three OS, as long as they are in the same language. I know it's a small step and the topic is totally depressing. So let's leave at that and move on to brighter shores...
But you could do that before by just using "Orientation" rather than whatever index it is assigned. :P
No: "Orientation" is just the column header. It does not, at least not necessarily, work as a property identifier (those all have to be in English!). Yes, the mess is that complex.

Your other ideas: Sorry, but I must go on now. Too many (sorry) better things on my list.

klownboy
Posts: 4148
Joined: 28 Feb 2012 19:27

Re: Minor scripting related wishes (a generic thread)

Post by klownboy »

Hi TheQuerty,
As Don was getting to, the change does allow me within the same same language to obtain the index for "Orientation" for example and use that in all English systems. The new get("propertyindex", propertyname) will get the index in Windows 7 as #245, in Windows 8, unfortunately it's #254. So it at least provides some scripting compatibility within the same language. See the change I just made here: http://www.xyplorer.com/xyfc/viewtopic. ... 662#p89662. The actual property value within the same language is the same (e.g., "Normal" or "Rotate 270 degrees"). It certainly would be more powerful to be able to pull out the actual property value for a particular file, in this case, "Rotate 270 degrees" as well as the property index, #245 for "Orientation".

By the way, my original problem was we could not use "Orientation" in "property" or "report", only the index which in this case is different on different systems...on highends system, it was #254, my Windows 7 #245 and my Windows 8, #254.
Ken.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

Don, any chance for another new Get parameter?

'MainMenuCaptions', [separator="|"], [flags]
Returns the main menu captions in the currently loaded language.
flags:
2 = Strip accelerators.
return: The main menu caption.


I only use 2 for the flag so that it matches MenuCaption, but I'm not partial so feel free to make it 1, 3, or 191729. Okay.. maybe just stick with 1 or 2. ;)


The reason this would be useful goes back to that script to turn the main menu into a CTB. While I can get the localized main menu captions, the only way to currently get the access keys would be to read the active language file.




// Delayed response to the last two posts: I hadn't realized you and klownboy were talking about the column header instead of the property name. It all makes much more sense to me now - though I think a way to retrieve the full list of indexes, names, and column headers would still be useful.

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Re: Minor scripting related wishes (a generic thread)

Post by nerdweed »

Don,
Can a scripting function be added that does the below be added please
It takes a delimited file as an input which is a plain listing of folders and files. All folders and files in this file will be listed in the active pane. By default the contents of the folders should not be shown as if required that can be achieved through multi branch view.
This can be currently done through some scripts already available on forum but they use tags and it adds an additional overhead and avoiding tags is one of the reasons for this wish. Tags are good, very good but big tags database can slow XY down. And all these files need not necessarily be used on all XY sessions. This can be achieved with multi tags database and custom event actions, but this would help only if the input file is created while daily use. On many occasions, we might have files with locations and would need to see some particular files only. Like, a huge backup where few files failed. The text file can be filtered to show only failed paths and then with this function, all those files are displayed in a single location ready for an reattempt.

If there are other ways to achieve this, please let me know.

Edit: You may create a full blown feature File Magnet for this and use the magnet icon that you want to use here - http://www.xyplorer.com/xyfc/viewtopic. ... 311#p94293

File Magnet - Magnets the file lists to the active pane.

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

Sounds like Virtual Folders to me. The plan for this is on my desk since long, and 99% finished. Patience...

Filehero
Posts: 2646
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Minor scripting related wishes (a generic thread)

Post by Filehero »

admin wrote:....., and 99% finished.
:shock: :om: :om: :cup: :cup:
Image

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

:biggrin: Don't dance too early! It's 99% finished for many years now. The last 1% is the tricky one...

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: Minor scripting related wishes (a generic thread)

Post by Enternal »

Filehero wrote:
admin wrote:....., and 99% finished.
:shock: :om: :om: :cup: :cup:
Image
Image
Image
admin wrote::biggrin: Don't dance too early! It's 99% finished for many years now. The last 1% is the tricky one...
Image
:cup: :beer: :cup: :beer:

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Re: Minor scripting related wishes (a generic thread)

Post by nerdweed »

A wish for two functions. I was surprised the first one isn't available.

1. FindTagged = Exact functionality is already available at GUI, but require the output to be redirected to a variable. As a workaround this can be done by doing a goto in a new tab and then copying the filenames to a variable; however; this doesn't seem very good for large lists as it would unnecessarily populate other fields as well that aren't required.

FindTagged (type="value" [and/or type="value"], location, separator )
where
type = Label (lbl), comment (cmt), tag, ex1-5 (ex:name)
value = matching condition
multiple conditions can be provided
location = Empty (Search Everywhere)
FolderPath\* (Search branch)
FolderPath (Search here only)
Separator = Separate the output (defaults to |)
which returns
Separator separated values matching the provided criteria


2. PreviewItems - Slideshow of Folders containing tens of thousands of images. Most likely to be terminated after watching a few hundred items. Doing a branch view and then initializing it causes unnecessary delay. I got a little carried away and asked for Order and Slideshow as well :)


PreviewItems (Itemlist, Type, Separator, Order, Slideshow, Recursive)
where
ItemList = File names or A file containing Filenames or Folder Name or Current List
Type = Full Screen Preview or Floating Preview
Separator = Defaults to |
Order = S (Sequential according to the provided order (sorted column for List))
N (Natural - Sorted by Name)
R (Random)
Slideshow = 0 (No slideslow)
x = positive value means yes, every x seconds
Recursive = Only applicable for folder, recursive would navigate through Sub-folders as well

admin
Site Admin
Posts: 60644
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Minor scripting related wishes (a generic thread)

Post by admin »

LOL, these are not "minor scripting related wishes". Sorry, but these two don't fit on my list right now.

However, I like them both (and they are well laid out, thanks)! One day I might find the time...

Post Reply