How to define a tab if it is open and updated with a new hyperlink in Vbscript?

I have a script that opens a hyperlink with a variable to pull out a specific intranet account. However, if the โ€œmoduleโ€ is already open (80% of the hyperlinks are the same), I would just like to leave the same tab / window open and update it.

Right now, my Vbscript just uses the host script and every time it opens in a new tab. Since the user can open several tabs, I'm not sure how to indicate if they have a link that I want to open, and then use this window to update the data.

Begin pseudocode Script Sub dim LINK as string dim variableHere as string LINK = "link/section/comments.aspx/account=" & variableHere & "&SID=11111" variableHere = APIAccountNumberAccessed IF ("link/section/comments.aspx/account=" exists) then open hyperlink in same tab: LINK else open in new tab End IF End pseudocode Sub 

UPDATE:

I made some progress in determining that the Window.Open method can be used to set the target name and open the link. However, I still get the error message.

Syntax

 set varWindow = Window.Open "google.com", "targetName", "toolbar=no, menubar=no, location=no, directories=no" 

This gives me the expected end of the report, error code 800A0401, right in the open line of the window. Still can't get past this part.

+4
source share
1 answer

This is an automatic function if you reuse targetName
therefore, you can use the same destination address and targetName to have one tab per URL. eg:

 Window.Open variableHere, variableHere, "toolbar=no, menubar=no, location=no, directories=no" 

I donโ€™t remember if targetName accepts any weird character, if not, you can replace

 validName = variableHere validName = replace(validName,"/","_") validName = replace(validName,".","_") validName = replace(validName,",","_") '... and so on ... Window.Open variableHere, validName, "toolbar=no, menubar=no, location=no, directories=no" 
+1
source

All Articles