Page 1 of 1

open with option on catalog?

Posted: 20 May 2020 20:58
by Oshy
I have some PDF's in my catalog. Sometimes I need to open them with acrobat reader and sometimes I need to open them with google chrome. Is there a way that I can do this?

Re: open with option on catalog?

Posted: 20 May 2020 21:32
by highend
Sure. Switch the catalog entries to
Action on click: Open Item

Add an entry to the "Portable File Associations" (e.g. Menu - Tools - List Management - Portable File Associations...) and adapt the paths to Adobe Acrobat and Chrome...

Code: Select all

"Open pdf" pdf>::$v = <pfaitem>; $m = popupmenu("Adobe|Chrome"); if ($m LikeI "adobe") { openwith """C:\some path\name of acrobat.exe"" ""$v"""; } elseif ($m LikeI "chrome") { openwith """C:\some path\name of chrome.exe"" ""$v"""; }

Re: open with option on catalog?

Posted: 20 May 2020 22:46
by Oshy
Cool! Thanks bud.

Re: open with option on catalog?

Posted: 04 Nov 2021 22:17
by kodyman
highend,

I have a similar use for what you have helped with here. Except for url's to select between two browsers.
Split this to a new post if you think it should be separated from the original.
I've mentioned in other posts that I am using XYp for a bookmark manager. There are a few sites that I go to regularly and wanted to add them to a catalog category to access more easily. Some do better with one browser, others with the other. I have modified your code above for url's and it is partly working. But one thing has me confused. Here is what I am seeing.
First off, Pale Moon is 32 bit installed in C:\Program Files (x86) and is set as the default browser. Slimjet is 32 bit running in portable mode in an F:\ partition of the same drive. Currently using XYp 22.30.0200.

Here is the modified code I have placed and enabled in Menu - Tools - List Management – Custom File Associations...

Code: Select all

"Open URL" url>::$v = <pfaitem>; $m = popupmenu("Slimjet|Palemoon"); if ($m LikeI "Slimjet") { openwith """F:\Slimjet\slimjet.exe"" ""$v"""; } elseif ($m LikeI "Palemoon") { openwith """C:\Program Files (x86)\Pale Moon\palemoon.exe"" ""$v"""; }
The way I am adding the bookmarks to different folders in XYp is by drag & drop. As you are aware, this creates a file with the filename being the title from the web page with the contents of the file like this example:
(I can't get the text to display properly here. The contents are the same as shown in the 1st screenshot below)


[InternetShortcut]
URL=index.php


After setting up a category in the catalog, I have drag & dropped (copied) some of these files to the category. When I click on one of these links the two browser selections pop up as expected. If I select Pale Moon it loads and opens the site in a tab just as it should. But if I select Slimjet it opens and pops up at tab showing this:

Slimjet Shot 1.png

What can be modified in the code to allow Slimjet to open the link instead of showing the text.

While I am at it, here is another unusual thing I have found.
I open the folder in the main window that contains the above link and it is displaying in list view.
I go to the same link as above, open the context menu with right-click and click Open with and both browsers are shown. Selecting Palemoon works fine and selecting Slimjet the same thing happens as above.
BUT, when using context menu Open with… - #173 this pops up:

Open with 173.png

If I select Open URL the same pop up is displayed as it does in the catalog. And selection of either in this pop up has the same problem as above. If I select Open in Slimjet Portable Browser or Open in Pale Moon they both work perfectly. I don't know why the FlashPeak Slimjet selection is also showing. I have been trying to track that down to get rid of it. It also pops up in the Open with context menu.

Since Open with… #173 works, should it be used in the code? And if so, where please? Or is your openwith in the code the same as #173?

Thanks for reading. Any suggestions or clarifications needed let me know.

Re: open with option on catalog?

Posted: 04 Nov 2021 22:26
by highend
Why don't you do it like this then?

Code: Select all

"Open URL" url>::$v = <pfaitem>; $m = popupmenu("Slimjet|Palemoon"); if ($m LikeI "Slimjet") { $url = getkey("URL", "InternetShortcut", $v); openwith """F:\Slimjet\slimjet.exe"" ""$url"""; } elseif ($m LikeI "Palemoon") { openwith """C:\Program Files (x86)\Pale Moon\palemoon.exe"" ""$v"""; }

Re: open with option on catalog?

Posted: 06 Nov 2021 18:39
by kodyman
Hi highend,

Thank you for the new code. I replaced the code I modified with it and the selected link opens in the appropriate browser. Both in the catalog and the context menu Open with… #176. (I inadvertently mistyped #173 in my last question above)
It isn't a big problem but something unusual does happen that must be browser related since it is a little different with each one. Not every time and I haven't been able to come up with a repeatable reason.
If I open any link with Palemoon sometimes it only opens one new tab and other times it opens two new identical tabs to the link clicked. With Slimjet, sometimes it will open just one tab to the web site as it should. Other times a second will open and showing the text [InternetShortcut] like in the screenshot above with the URL equaling the address of the site I'm opening. And other times the second tab opens with a list of all of URL's in the folder containing the link I selected. Again, it hasn't been repeatable.
I did think maybe it possibly had to do with the way I might be clicking with the mouse button, too fast or slow, but I checked and it wasn't. There is no rhyme or reason I have figured out. So I just delete the second tab when it happens.

It is probably something with the two browsers but I wanted to post what I was seeing in case others use the code and see something similar.

Thank you again!