Feature Request - open link in ctrl+z comments directly

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Dwhite
Junior Member
Junior Member
Posts: 8
Joined: 2019-11-19, 10:58 UTC

Feature Request - open link in ctrl+z comments directly

Post by *Dwhite »

I often add url as comment information for file/folder.
Is there a way to quickly open that url with a command? hotkey? or combine key? without ---
open comment - copy - paste to browser

PS: There is only url in the comment content.
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Feature Request - open link in ctrl+z comments directly

Post by *Stefan2 »

Dwhite wrote: 2019-11-19, 11:08 UTC I often add url as comment information for file/folder.
Is there a way to quickly open that url with a command? hotkey? or combine key?
without ---open comment - copy - paste to browser
PS: There is only url in the comment content.

You can use an script (VBS, JS, AutoHotkey, PowerShell) to
- take the name of the selected file (TC parameter "%P%O.%E")
- parse the descript.ion file ("%Pdescript.ion")
- for that name and read the comment
- if the comment is an URL > execute it

Such script you can use as button or assign an hotkey to it.



 
soc
Junior Member
Junior Member
Posts: 8
Joined: 2019-11-30, 12:48 UTC

Re: Feature Request - open link in ctrl+z comments directly

Post by *soc »

You can use an script (VBS, JS, AutoHotkey, PowerShell) to
- take the name of the selected file (TC parameter "%P%O.%E")
- parse the descript.ion file ("%Pdescript.ion")
- for that name and read the comment
- if the comment is an URL > execute it
Awesome idea. Will anyone write a script, please?
Last edited by soc on 2019-12-04, 19:48 UTC, edited 1 time in total.
soc
Junior Member
Junior Member
Posts: 8
Joined: 2019-11-30, 12:48 UTC

Re: Feature Request - open link in ctrl+z comments directly

Post by *soc »

To Stefan2:

Will you write a script? AHK or VBS maybe.

Sor
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Feature Request - open link in ctrl+z comments directly

Post by *Stefan2 »

soc wrote: 2019-12-04, 16:28 UTC To Stefan2:

Will you write a script? AHK or VBS maybe.

Sor
Let's say it's on my "todo" list :D ... but I have no time right now to fork my
spare time even more,... should be easy task, but often takes time to test ...and the little details...



Any other takers? :wink:

I am thinking about a script which takes current selected file as parameter
- split path and open "path\descript.ion" file
- parse descript.ion for the file name and take the comment part
- if the comment starts with (what? http? www? ...?) > execute it to open the system default application for url.


- - -

F A Q s: File comments descript.ion (descriptions Ctrl+Z)
viewtopic.php?f=3&t=52534&p=355053


 
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Feature Request - open link in ctrl+z comments directly

Post by *Stefan2 »

 

arrg,... anyway, here is version 1, quick&dirty,... please try




Dwhite wrote: 2019-11-19, 11:08 UTC I often add url as comment information for file/folder.
Is there a way to quickly open that url with a command? hotkey? or combine key? without ---
open comment - copy - paste to browser

PS: There is only url in the comment content.


My test "descript.ion" file:
CGLPT64.SYS Parallel port driver for Windows XP/Vista/7/8/8.1/10 x64
"zzTest - Kopie.txt" www.pspad.com
zzTest.txt www.microsoft.com
zzTest 2.txt-->ghisler.ch
CABRK.DLL CAB unpacker DLL




Code: Select all

'##########################################
'https://ghisler.ch/board/viewtopic.php?f=3&t=54909&p=364314#p364314
'Re: Feature Request - open link in ctrl+z comments directly
'##########################################
'09:38 - 05.12.2019 v00.1 by Stefan
'-PURPOSE:
'-Script to read descript.ion file for selected file and read the comment:
'-- Select a file
'-- Click this button
'-- Script looks up the comment for that file from descript.ion
'-- Script execute that comment which is assumed to be an URL. . . . . . . . . . . <<< please BE carefull
'-
'-BUTTON HELP:
'Create a plain text file with name ExecuteURLFromComment.vbs
'Copy this code to that file.
'Drag&Drop that VBS file to TCs' button bar
'Edit the button to look like:
'Command: "D:\rive\path to this\file.vbs"
'Parameters: "%P" "%O.%E"
'Start path:
'Icon: C:\WINDOWS\System32\WScript.exe --- or wcmicons.dll --- or what you want
'Tooltip: your description here

'##########################################
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WSO = CreateObject("WScript.Shell")
'msgbox Wscript.arguments.Count 'Please provide two args, so we don't have to split path and file our self ;-)
IF(Wscript.arguments.Count >1) THEN
	sPATH = Wscript.arguments.Item(0) ' The current active folder, due to the "%P"  param
	sFILE = Wscript.arguments.Item(1) ' The current selected file, due to the "%O.%E"
	sFileToRead  = sPATH & "descript.ion" ' The descript.ion file in the current active folder
ELSE
	MsgBox "Error, need to parameters: %P and %O.%E , best in quotes! See VBS-Code at BUTTON HELP.    Bye."
	WScript.Quit
END IF

If((sPATH="") OR (sFILE="")) Then MsgBox "sPATH %P or sFILE %O.%E is missing, check Button parameters. Bye." : WScript.Quit

If FSO.FileExists(sFileToRead) Then 
	 'out = "File found: "&vbLF&vbLF&"Search: "&sFileToRead&vbLF&vbLF&"For: "&sFile : MsgBox out
Else
	MsgBox "no descript.ion "&vbLF&sFileToRead&vbLF&" file found in that folder!!!    Bye." : WScript.Quit
End If 

Set oTextStream = FSO.OpenTextFile(sFileToRead,1)
Do Until oTextStream.AtEndOfStream
	c=c+1
	L=oTextStream.ReadLine
	L=replace(L,chr(9),chr(32))
	L=trim(L)
	If(Left(L,1)=chr(34)) Then 
		FNE=InStr(2,L,chr(34))
	Else
		FNE=InStr(2,L,chr(32))
	End If
	FN = Left(L,FNE)  : FN=replace(FN,chr(34),"") : FN = Trim(FN)
	FC = Mid(L,FNE+1) : FC = Trim(FC)
	'msgbox c & ". "&vbLF&"Line: "&L&vbLF&"FileName: "&FN&vbLF&"FileComment: "&FC &vbLF&vbLF&vbLF&sFILE
	If(FN=sFILE) Then
		msgbox "FOUND.... File " & FN & " has comment " & FC
		'ToDo: check comment if it *IS* an URL
		'ToDo: prompt user if he realy *WANT* to execute that URL
		WSO.run FC
		WScript.QUIT
	End If
Loop
oTextStream.Close
MsgBox "i am done, but nothing was found."
'##########################################






HTH? :D
User avatar
Gral
Power Member
Power Member
Posts: 1460
Joined: 2005-01-26, 15:12 UTC

Re: Feature Request - open link in ctrl+z comments directly

Post by *Gral »

Dwhite wrote: 2019-11-19, 11:08 UTC I often add url as comment information for file/folder.
Is there a way to quickly open that url with a command? hotkey? or combine key? without ---
open comment - copy - paste to browser

PS: There is only url in the comment content.
And this is my very simple AHK script (and quick and dirty too)
(Using F12 as a hotkey)

Code: Select all

#NoTrayIcon
F12::
{
Send, {CTRLDOWN}zac{CTRLUP}, {ESC}
Run, %clipboard%
Return
}
User avatar
Stefan2
Power Member
Power Member
Posts: 4132
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Feature Request - open link in ctrl+z comments directly

Post by *Stefan2 »

Gral wrote: 2019-12-05, 10:45 UTC Send, CTRL+zac
Run, %clipboard%


haha :mrgreen: , where is the thumbsup emoji if we need one? :D


Good work :thumbsup : :wink:           (thumbsup works for me only on a few browser)








 
soc
Junior Member
Junior Member
Posts: 8
Joined: 2019-11-30, 12:48 UTC

Re: Feature Request - open link in ctrl+z comments directly

Post by *soc »

The script works! And of course the keystrokes of AHK also does. Exactly as requested by Dwhite.

I was however of the impression that url will coexist with comment text and the script would seek out the url and execute it. Can this be done?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6449
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Feature Request - open link in ctrl+z comments directly

Post by *Horst.Epp »

soc wrote: 2019-12-05, 13:26 UTC The script works! And of course the keystrokes of AHK also does. Exactly as requested by Dwhite.

I was however of the impression that url will coexist with comment text and the script would seek out the url and execute it. Can this be done?
The original poster said
"PS: There is only url in the comment content."
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
Hacker
Moderator
Moderator
Posts: 13052
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Feature Request - open link in ctrl+z comments directly

Post by *Hacker »

Gral,

Code: Select all

Send, {CTRLDOWN}zac{CTRLUP}, {ESC}
:arrow:

Code: Select all

Send, {CTRLDOWN}zac{CTRLUP}{ESC}
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
Dwhite
Junior Member
Junior Member
Posts: 8
Joined: 2019-11-19, 10:58 UTC

Re: Feature Request - open link in ctrl+z comments directly

Post by *Dwhite »

Sorry for the late reply...
Thank you so much for all of you especially Stefan2 Gral !!!

The VBS file works great.
The ahk file have bugs —— its OK when I selected the file with comments, but when I target to the file without comments, it still open the link in the .ion's first file comments. namely www.google.com see blow.
F12 works on all files(no matter it contains comments or not) in the same folder.
eg.
second.txt www.youtube.com
first.txt www.google.com

@Hacker
you change seems doesn't work...(for me)


What I said "PS: There is only url in the comment content."
I just wanna make the question more simple.
Maybe we can use regular expression to capture the URL links.
But this is just my idea, I am not and I have no rights to ask anyone to write a script for that.

for now, Stefan2's script works great already.
Thanks again!
Best regards.
Post Reply