Minor scripting related wishes (a generic thread)

Features wanted...
Post Reply
SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Minor scripting related wishes (a generic thread)

Post by SkyFrontier »

Selfilter could distinguish between "file_", "file_01" and "file_02" (eXact match)?

Code: Select all

::Selfilter "file_";
Selects them all;

Code: Select all

::SelfilterX "file_";
Selects "file_" only.

Also, I'm not finding a way to append selections/different patterns to selfilter. Is it possible? How?
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: Minor scripting related wishes (a generic thread)

Post by Stefan »

SkyFrontier wrote:Selfilter could distinguish between "file_", "file_01" and "file_02" (eXact match)?

Also, I'm not finding a way to append selections/different patterns to selfilter.
Is it possible? How?
Well reading the help helps sometimes:

Code: Select all

Scripting Commands Reference
selfilter """readme"""; 
Selects item named "readme" and only that one item.
or
selfilter quote("file_"); :wink:

SkyFrontier
Posts: 2341
Joined: 04 Jan 2010 14:27
Location: Pasárgada (eu vou!)

Re: Minor scripting related wishes (a generic thread)

Post by SkyFrontier »

...I was almost sure I was missing something. Now I am. :oops:
Thanks, Stefan!
New User's Ref. Guide and Quick Setup Guide can help a bit! Check XYplorer Resources Index for many useful links!
Want a new XYperience? XY MOD - surfYnXoard
-coz' the aim of computing is to free us to LIVE...

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

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

From my trials it seems the only easy way to get a list of available drives is to loop through and check each letter with exists(), which can be a slow at times. It doesn't seem possible to use ListFolder() to do this, and Report() could work but I'd have to open a tab/go to %computer%.

Given the new(-ish) drive toolbars, I'm thinking this has got to be easier now, so I suggest a new Info option for Get().

"Drives", [separator="|"], [group="All"] (or swap the last two, I'm just going off SelectedItems*Names)
The optional "group" argument can be:
All
Available
Fixed
Removable
Network
Optical

Corresponding with the TB groups, except the last, and preferably first partial matched.

Pretty please, Don! :(

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

Re: Minor scripting related wishes (a generic thread)

Post by admin »

Made a note.

Optical? I'm not aware of a flag to test that.

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

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

admin wrote:Optical? I'm not aware of a flag to test that.
Just bringing the term "CD-ROM" into the present, since I doubt there are that many CD drives still around.

admin
Site Admin
Posts: 60357
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:Optical? I'm not aware of a flag to test that.
Just bringing the term "CD-ROM" into the present, since I doubt there are that many CD drives still around.
Ah, as a cover for CD, DVD, and Blu-ray drives. Ok. But even under Win7 my DVD drive is still labeled "CD drive".

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

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

admin wrote:Ah, as a cover for CD, DVD, and Blu-ray drives. Ok. But even under Win7 my DVD drive is still labeled "CD drive".
Well you can call it whatever you like, if Windows 7 is still calling them CD drives then so be it. (Though anyone have word from Windows 8?)

Personally, I feel it's silly to continue to call them CD-ROMs just because Microsoft weren't forward thinking when they created the drive type enum. :P

admin
Site Admin
Posts: 60357
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:Ah, as a cover for CD, DVD, and Blu-ray drives. Ok. But even under Win7 my DVD drive is still labeled "CD drive".
Well you can call it whatever you like, if Windows 7 is still calling them CD drives then so be it. (Though anyone have word from Windows 8?)

Personally, I feel it's silly to continue to call them CD-ROMs just because Microsoft weren't forward thinking when they created the drive type enum. :P
Heritage. Who uses "Computers" for computing nowadays? Not the masses...

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

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

admin wrote:Heritage. Who uses "Computers" for computing nowadays? Not the masses...
Right up there with the standard floppy disk icon for Save.

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

Re: Minor scripting related wishes (a generic thread)

Post by TheQwerty »

Thanks Don!

Kind of wish you had used the text arguments for type, but in a couple minutes I'll be over that. :P

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Minor scripting related wishes (a generic thread)

Post by zer0 »

I desperately need a way to determine frame width and height of video files. When I preview such a file, I can see that information in the area in the top right corner of the preview panel, but how do I retrieve it using scripting. There does not seem to be a set of arguments that I can use with property() to grab it :(
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

nas8e9
Posts: 2232
Joined: 21 Jun 2008 14:50

Re: Minor scripting related wishes (a generic thread)

Post by nas8e9 »

zer0 wrote:I desperately need a way to determine frame width and height of video files. When I preview such a file, I can see that information in the area in the top right corner of the preview panel, but how do I retrieve it using scripting. There does not seem to be a set of arguments that I can use with property() to grab it :(
By way of a possible workaround, MediaInfo claims to be able to export its information to CSV among other formats. It has a command-line version, but I'm not sure how scriptable it is.
Last edited by nas8e9 on 24 Sep 2011 01:59, edited 2 times in total.

highend
Posts: 13274
Joined: 06 Feb 2011 00:33

Re: Minor scripting related wishes (a generic thread)

Post by highend »

I do this with the help of ffmpeg (in a greater context for my video convert script).

Let ffmpeg write it's data (simple ffmpeg -i <videofile> 2>yourlogfile.log)
and then use a simple foreach loop to extract the necessary data.

Code: Select all

 $FFmpegLog = readfile($FFmpegLogFile);
 foreach($Line, $FFmpegLog, "<crlf>"){
   $FindVideoResolution = regexreplace($Line, "(.+?)(\d+[x|X]\d+)(.+)", "$2");
   if($FindVideoResolution != $Line) { $SourceVideoResolution = $FindVideoResolution; }
 }
 $SourceVideoWidth = gettoken($SourceVideoResolution, 1, "x");
 $SourceVideoHeight = gettoken($SourceVideoResolution, 2, "x");
 text Resolution: $SourceVideoWidth x $SourceVideoHeight;

One of my scripts helped you out? Please donate via Paypal

zer0
Posts: 2673
Joined: 19 Jan 2009 20:11

Re: Minor scripting related wishes (a generic thread)

Post by zer0 »

highend wrote:I do this with the help of ffmpeg (in a greater context for my video convert script).
Thank you for a potential workaround. I would rather Don makes it possible through scripting, which should be a trivial exercise.
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Post Reply