Sign in to follow this  
Followers 0
Bucktail

PDF Finder

1 post in this topic

Here is a simple standalone script I created that helps locate and open up pdf drawings from a directory that hold thousands of PDF files. Unfortunately this scrip also shows just how limited my scripting abilities are. You could change it to look for just about any sort of file. I think all you would have to do is change the $path and $ext

; Script Function:

; Checks for PDF file and the opens the requested PDF file.

$path = "\\CorpData\Data1\drawingpdfs\"

$ext = ".pdf"

; Loops until the user gives a valid PDF file or cancels

$bLoop = 1

While $bLoop = 1

$file = InputBox("PDF File To Open", "Please enter the PDF file number you want to open and click OK","","",250,175)

If @error = 1 Then

Exit

Else

$filepath = ($path & $file & $ext)

If FileExists($filepath) Then

ShellExecute( $filepath, "" , "" , "" , @SW_MAXIMIZE )

$bLoop = 0 ; Exit the loop - ExitLoop would have been an alternative too :unsure:

Else

MsgBox(0, " NOT VALID", "Not a Valid Number!")

EndIf

EndIf

WEnd

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0