Comments (or similar) as hyperlinks?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
sclg
Posts: 26
Joined: 23 Sep 2009 15:47
Location: UK

Comments (or similar) as hyperlinks?

Post by sclg » 16 Oct 2014 12:43

Is it possible to add a column that is a hyperlink to somewhere?
I know I can effectively paste a link into a 'Comment' but I'd need to cut and paste it to a browser to use it rather than just clicking it.

Reason is that I have a need to list the files in a folder and also store a web link to a set of instructions about that file.
It would be really useful to have that link as one of the columns in the file list!

Thanks

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

Re: Comments (or similar) as hyperlinks?

Post by highend » 16 Oct 2014 13:08

Yeah, possible.

E.g. you could use a tag and a custom column with a script, e.g.:

tag a file with:

Code: Select all

url:http://www.xyplorer.com
Don't leave "url:" out^^

Next, configure a custom column:
Caption: Maybe "URL"
Type: Script
Script:

Code: Select all

 $url = regexreplace(property("#tags", "<cc_name>"), "(.*?url:)([^,]+)(.*)", "$2");
 if ($url) { run "$url"; }
Format: Text
Trigger: Click
Item type: Files

Now add that custom column to your current view.

Clicking on the play icon for files that have a url:<url> tag will open this link in the default browser...
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

SammaySarkar
Posts: 4235
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Comments (or similar) as hyperlinks?

Post by SammaySarkar » 16 Oct 2014 13:36

Plus if you don't need the url column everywhere, read up on Folder View Settings in the help file.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

sclg
Posts: 26
Joined: 23 Sep 2009 15:47
Location: UK

Re: Comments (or similar) as hyperlinks?

Post by sclg » 16 Oct 2014 16:28

Many thanks - I'll give that a try.

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

Re: Comments (or similar) as hyperlinks?

Post by TheQwerty » 21 Oct 2014 14:43

highend wrote:E.g. you could use a tag and a custom column with a script, e.g.:
You could also use one of the Extra Tag columns with type Location. Then you can tag the item with locations to go to/display in a menu when that column is clicked.

Though in this case you'd want to use just 'http://www.xyplorer.com' and not include the 'url:' prefix.

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

Re: Comments (or similar) as hyperlinks?

Post by highend » 21 Oct 2014 18:51

Much better than my method, TheQwerty!

No play button in the column and the url is actually shown (instead of hidden) :)
One of my scripts helped you out? Please donate via Paypal or paypal_donate (at) stdmail (dot) de

sclg
Posts: 26
Joined: 23 Sep 2009 15:47
Location: UK

Re: Comments (or similar) as hyperlinks?

Post by sclg » 21 Oct 2014 20:29

Thanks - having alternatives is always good!
Steve

JLoftus
Posts: 296
Joined: 22 Jan 2014 14:58

Re: Comments (or similar) as hyperlinks?

Post by JLoftus » 08 Apr 2015 17:45

Taking this idea a step further, I use a great freeware app called "Linker for Windows" (http://teamscope.com/otherpro/linker.asp) which allows for the creation of hyperlinks to specific Outlook items. Every individual Outlook item has an underlying GUID. When this specially crafted URL is called, the Outlook item is opened (email, calendar item, contact, task, etc). The hyperlink that's created references an HKCR entry "Outlook" to call Outlook.exe with the parameter, and uses the format:

outlook:nnn (where nnn is the obnoxiously long GUID).

Pasting a hyperlink created by Linker for Windows into for example a Word document or a OneNote item, allows "linking" to the backing Outlook item. It's SUPER handy!

I have been playing with both of the ideas mentioned above, and neither is working to invoke this hyperlink. Using the Extra column method, XY opens a new tab with (naturally) the error that the location cannot be found. Using the script method with the custom column results in a "File not found" error in the custom column (yes, I did prepend the content with "url:", which itself was an extra manual step but one I could live with if the action worked).

Anyone who uses Outlook and has a few minutes to spare that could grab the TeamScope app (needs an email address to download it), I promise you will love the functionality... getting this working with XY would be nothing short of awesome.

Thanks!

Jeff

Edit: P.S. The download page says it's a 30 day trial but Linker is one of their exceptions, it's freeware

admin
Site Admin
Posts: 49444
Joined: 22 May 2004 16:48
Location: Cologne, Win 8.1, Win 10
Contact:

Re: Comments (or similar) as hyperlinks?

Post by admin » 08 Apr 2015 18:10

These are LNK or URL files?

What happens if you right-click such a file and choose "open" from the context menu?
FAQ | XY News RSS | XY Twitter | Stay home! 🎸 Or wear a mask! 😷

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

Re: Comments (or similar) as hyperlinks?

Post by TheQwerty » 08 Apr 2015 18:11

I suspect it's just installing registering a custom URL protocol & handler.

In XY's address try running this with one of those links:

Code: Select all

::open 'outlook:nnn';
If it opens correctly in Outlook then you can just use that script as the location. Though that makes the extra column data look rather ugly so you might want to prefix it with a caption:

Code: Select all

"Outlook" ::open 'outlook:nnn';

JLoftus
Posts: 296
Joined: 22 Jan 2014 14:58

Re: Comments (or similar) as hyperlinks?

Post by JLoftus » 08 Apr 2015 18:15

admin wrote:These are LNK or URL files?

What happens if you right-click such a file and choose "open" from the context menu?
These are any file types (pdf, doc, etc) which I would like to add a tag (or any other column) which contains the link created by Linker for Windows, and then have the ability to invoke that link by clicking that column for the selected item

JLoftus
Posts: 296
Joined: 22 Jan 2014 14:58

Re: Comments (or similar) as hyperlinks?

Post by JLoftus » 08 Apr 2015 18:16

TheQwerty wrote:I suspect it's just installing registering a custom URL protocol & handler.

In XY's address try running this with one of those links:

Code: Select all

::open 'outlook:nnn';
If it opens correctly in Outlook then you can just use that script as the location. Though that makes the extra column data look rather ugly so you might want to prefix it with a caption:

Code: Select all

"Outlook" ::open 'outlook:nnn';

Running ::open <link value> works!!!

Thank you TheQuerty!

edit: Got it! So, using the Extra1 column and making it the string TheQuerty used ("Outlook" ::open outlook:nnnn) works!

Thank you, thank you, thank you!

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

Re: Comments (or similar) as hyperlinks?

Post by TheQwerty » 08 Apr 2015 18:30

You should be able to also take an approach similar to highend's suggestion by tagging the files with the link:

Code: Select all

outlook:nnn
But then use a script like:

Code: Select all

 $url = regexreplace(property("#tags", "<cc_name>"), "(.*?)(outlook:[^,]+)(.*)", "$2");
 if ($url) { open "$url"; }
(Note though that I haven't tested this to verify.)

JLoftus
Posts: 296
Joined: 22 Jan 2014 14:58

Re: Comments (or similar) as hyperlinks?

Post by JLoftus » 08 Apr 2015 18:49

Yes, this works too!

I'm playing with both now, as each requires some manual manipulation of the hyperlink produced by Linker for Windows - it cannot simply be pasted to the tag, custom, or extra column as-is.

With the Extra column, I have to paste as text and then cleanup the html markup, as well as prepend a nice title.
With the Custom column method, I still have to remove the html markup and then that leaves the column "ugly" as noted earlier.

Thank you again for your ideas!

JLoftus
Posts: 296
Joined: 22 Jan 2014 14:58

Re: Comments (or similar) as hyperlinks?

Post by JLoftus » 08 Apr 2015 20:21

So I've managed to make this a bit easier by creating an AutoHotKey snippet to "fix up" the HTML text link created by Linker for Windows. (for this purpose, I have the "text" option selected in the Linker for Windows tray icon)

;--------------------------------------------------------------
StringTrimLeft, clipboard, clipboard, 12
tmp = "Outlook Item" ::open %clipboard%
clipboard := SubStr(tmp, 1, InStr(tmp, "'>", 0, 0) -1)
SendInput {Raw}%clipboard%
;--------------------------------------------------------------

This results in the ability to paste into the Custom Column data edit box, the properly formatted string needed for XY to launch the hyperlink.

Works a treat!

Thanks again to TheQuerty for the assistance coming up with the needed XY script syntax to launch the Linker for Windows hyperlink.

Post Reply