www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    Windows Explorer
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Posted
Hi

Is it possible to have jscript bring up a Windows Explorer type browse window allowing the user to go thru the directory stucture and select a file. The script then needs to pass the path and filename back to the field.

The reason for this is that spelling mistakes and having to remember and type the entire path is a lot to expect of the user.

Thanks
 
Posts: 13 | Location: Cape Town, South Arica | Registered: Tue June 19 2001Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
I would like to second this request. Our users want to search imported PDFs (fine) and also view the original PDF scans. I want to use the Javascript #6 solution for launching PDFs in Acrobat, but users will expect to be able to browse to, rather than type in, the filename.
 
Posts: 1 | Registered: Fri January 03 2003Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
Hi all,
I've managed to put together a Windows File Browse feature for including links to documents on your LAN.

However...

This solution requires Windows, Internet Explorer and WSH to run - if you are unsure if you have any of these, the best way to find out is to try...

The browser is basically a HTML file - I suggest putting it into the same folder as your textbase. I've attached the whole code below, but if you're having trouble with it, stick a note on here and I'll email it to you.

Here goes:
************************************************
<html>
<head>
</head>
<body>
<input type="file" id="filebrowse" style="display:none">
<TEXTAREA ID="holdtext" STYLE="display:none" rows="1" cols="20"></TEXTAREA>
<script language="JavaScript">
var filebox = document.getElementById('filebrowse');
filebox.click();
var filename = filebox.value;
if (filename == "undefined"){
alert('An invalid link has been selected. A link will not be inserted.');
clipboardData.clearData();
}
else{
holdtext.innerText = filename;
Copied = holdtext.createTextRange();
Copied.execCommand('Copy');
}
</script>
<script language="VBScript">
Set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate "Inmagic"
WshShell.SendKeys "%"
WshShell.SendKeys "W"
WshShell.SendKeys "O"
WshShell.SendKeys "^v"
</script>
</body>
</html>
************************************************

OK, the next thing to do is to attach a button on your Record Edit screen to this document. Insert a new script button (in the example below, it's named 'hypebutton'), and add the following VBScript code to the Form Script:

************************************************
Sub hypebutton_onClick()
Form.boxes("Hyperlink").setFocus()
Application.appWindow("Q:/textbase/intranet/filebrowse.htm")
End Sub
************************************************

Clicking on this button activates the file browse function in the HTML page, which then (using WSH), closes the HTML page, and pastes the link into the field you specify.

Mildly complicated, a little clumsy, but it has worked for me!
 
Posts: 87 | Location: Melbourne, Victoria, Australia | Registered: Fri May 11 2001Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  Scripting    Windows Explorer