Please tell me if there is a similar WDX plugin xpdfsearch (works in total) script /plugin for XY?
The task is as follows:
Is it possible that when renaming, the number of sheets of the file being renamed should be indicated (interested only in pdf)?
That is, there are for example 3 files: text_document 1.pdf and 2, 3. In 1 - 3 sheets, in 2 - 4, sheets, in 3 - 10 sheets. The task is to add to the file name the number of sheets of which it consists, so that the output would have - text_document 1_3l.pdf; text_document 2_4l.pdf; text_document 3_10l.pdf.
Currently I use the TC for renaming, but the permanent manager built into the vin is XY, so it would be more convenient to do everything in one place
If possible, please describe how to use these?
Thanks!
Specifying the number of document sheets in the name when renaming files in bulk
-
OIV88
- Posts: 20
- Joined: 24 Sep 2023 21:06
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Specifying the number of document sheets in the name when renaming files in bulk
Scripting is the way to go...
You need: https://github.com/oschwartz10612/poppl ... s/releases
and ofc adapt the path to it in the script...
You need: https://github.com/oschwartz10612/poppl ... s/releases
and ofc adapt the path to it in the script...
Code: Select all
$pdfInfo = "D:\Tools\@Command Line Tools\poppler_x64\pdfinfo.exe";
end (exists($pdfInfo) != 1), quote($pdfInfo) . " not found, aborted!";
setting "BackgroundFileOps", 0;
foreach($item, <get SelectedItemsPathNames>, <crlf>, "e") {
$path = gpc($item, "path");
$base = gpc($item, "base");
$result = runret(lax("$pdfInfo" "$item"), , 65001);
$pages = regexmatches(regexmatches($result, "^Pages:.+?$"), "\d+$");
if !($pages) { continue; }
$name = $base . "_" . $pages . "l.pdf";
renameitem($name, $item);
}
One of my scripts helped you out? Please donate via Paypal
-
admin
- Site Admin
- Posts: 66098
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Specifying the number of document sheets in the name when renaming files in bulk
Don't know where it comes from but I have a shell property "Pages" here that does the job for PDFs and DOCXs.
To see the attached files, you need to log into the forum.
FAQ | XY News RSS | XY X
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Specifying the number of document sheets in the name when renaming files in bulk
Maybe MS Office is installed?
One of my scripts helped you out? Please donate via Paypal
-
OIV88
- Posts: 20
- Joined: 24 Sep 2023 21:06
Re: Specifying the number of document sheets in the name when renaming files in bulk
Thank you very much for the quick answers!
Is it possible to go into more detail on how to implement all this in the program?
Unfortunately, I don't understand these issues
Was very grateful for the help
Is it possible to go into more detail on how to implement all this in the program?
Unfortunately, I don't understand these issues
Was very grateful for the help
-
admin
- Site Admin
- Posts: 66098
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Specifying the number of document sheets in the name when renaming files in bulk
Yep, that was it, compared the dates (using Registry Workshop).
FAQ | XY News RSS | XY X
-
highend
- Posts: 14925
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Specifying the number of document sheets in the name when renaming files in bulk
Doesn't seem to be the only necessary thing.Yep, that was it
Tried 2010, 2013, 2016, 2019 and 2021 and none of them lead to a number for the pages property of a .pdf
Additionally installed a full pdf reader (Foxit), still no pages property filled...
Put that script e.g. on a button.Is it possible to go into more detail on how to implement all this in the program?
Menu - Help - Contents and Index
Main Topics - Toolbar - Custom Toolbar Buttons
How to add a User Button: To add a new user button to the toolbar you first open the Customize Toolbar dialog (menu Tools) and add a User Button (bottom of the list) to the current buttons. Then you right-click the button in the toolbar and select Edit... In the Edit User Button dialog you set the Name and Icon (both optional) for the button, and at least one Script (required) that is triggered when clicking the button. That's all. Of course, the buttons are stored between sessions and portable.
One of my scripts helped you out? Please donate via Paypal
XYplorer Beta Club