hello sir,
i am able to open selected pdf files using xyplorer script using
OpenWith """C:\Foxit PhantomPDF editor 5210201\Foxit PhantomPDF.exe"" <items>";
assuming clipboard contains the path of files as
D:\10th class\books\NCERT_CLASS_10_MATHEMATICS_ENGLISH.pdf
D:\10th class\books\NCERT_CLASS_10_HINDI_KRITIKA_2.pdf
D:\10th class\books\NCERT_CLASS_10_ENGLISH_FIRST_FLIGHT.pdf
D:\10th class\books\NCERT_CLASS_10_MATHEMATICS_ENGLISH.pdf
how to modify the above script to open mulitple files using the path in the clipboard?
i tried
OpenWith """C:\Foxit PhantomPDF editor 5210201\Foxit PhantomPDF.exe"" <clipboard>"; but it is not working.
could you please help?
script to open multiple files paths from clipboard
Re: script to open multiple files paths from clipboard
By reformatting the clipboard content to a list of quoted, space-separated items?
One of my scripts helped you out? Please donate via Paypal
Re: script to open multiple files paths from clipboard
could you please write the code sir?
Re: script to open multiple files paths from clipboard
You need
quote() | trim() and replace(), go and read their documentation and write it yourself?One of my scripts helped you out? Please donate via Paypal
Re: script to open multiple files paths from clipboard
some how i made it to work with the following code.
"open from clipboard"
set $SelectedItems, <clipboard>;
foreach($Item, $SelectedItems, "<crlf>") {
if($Item == ""){ break; }
else{
OpenWith """C:\Foxit PDF Editor Pro 2024.2.0.25138\FoxitPDFEditor.exe"" $Item";
}
}
"open from clipboard"
set $SelectedItems, <clipboard>;
foreach($Item, $SelectedItems, "<crlf>") {
if($Item == ""){ break; }
else{
OpenWith """C:\Foxit PDF Editor Pro 2024.2.0.25138\FoxitPDFEditor.exe"" $Item";
}
}
Re: script to open multiple files paths from clipboard
Code: Select all
"open from clipboard"
set $SelectedItems, <clipboard>;
foreach($Item, $SelectedItems, "<crlf>") {
if($Item == ""){ break; }
else{
OpenWith """C:\Foxit PDF Editor Pro 2024.2.0.25138\FoxitPDFEditor.exe"" $Item";
}
}Re: script to open multiple files paths from clipboard
If FoxitPDFEditor.exe automatically skips items that don't exist, you're lucky because you aren't quoting them...
You are assigning the clipboard to a variable for no reason, you could also directly use it for the loop
Your
So you could have it written as (still without correct quoting or a fix for the openwith):
And one way to do everything correctly:
You are assigning the clipboard to a variable for no reason, you could also directly use it for the loop
foreach has a flag to skip empty items so the whole if ... else statement in the loop is unnecessaryYour
openwith call is totally malformed (read the docs^^)So you could have it written as (still without correct quoting or a fix for the openwith):
Code: Select all
"open from clipboard"
foreach($Item, <clipboard>, <crlf>, "e") {
OpenWith """C:\Foxit PDF Editor Pro 2024.2.0.25138\FoxitPDFEditor.exe"" $Item";
}
Code: Select all
"open from clipboard"
$items = replace(trim(<clipboard>, <crlf>), <crlf>, '" "');
run """C:\Foxit PDF Editor Pro 2024.2.0.25138\FoxitPDFEditor.exe"" ""$items""";
One of my scripts helped you out? Please donate via Paypal
Re: script to open multiple files paths from clipboard
thanks a lot sir.
XYplorer Beta Club