Not sure why the script below does not display the selected PDF File
from my Mac HD.  I checked the filepath in the  variable tFile and it looks correct.
If I feed tFile a web address instead, then the web page displays without issue
in the rev browser. Thanks - Jorge
on MouseUP
   local tBrowserId
   local tFile
   answer file "Please choose the file you would like to display" with type "PDF document|pdf|PDF"
   
   if it is not empty then
     put it into tFile
  end if  
   put revBrowserOpen(the windowId of this stack,tFile) into tBrowserId
   if tBrowserId is not an integer then
      answer "Failed to open browser"
      exit mouseUp
   end if
   
   revBrowserSet tBrowserId, "showborder","true"
    
   revBrowserSet tBrowserId, "rect", "116,14,1198,660"
end mouseUp
			
			
									
									
						revBrowserOpen Local PDF File
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: revBrowserOpen Local PDF File
I used the Safari browser to open the PDF files directly and noted that there were
no empty spaces in the filepath used by Safari. Instead there was a "%20" where
a space would normally be in the filepath.
So I added this line of script and it works -
replace space with "%20" in tFile
So /Users/Documents/Some Folder/This Thing.PDF will not open in revBrowser but
/Users/Documents/Some%20Folder/This%20Thing.PDF will
Not sure why this is the case but at least it works. Any ideas?
Thanks. - Jorge
			
			
									
									
						no empty spaces in the filepath used by Safari. Instead there was a "%20" where
a space would normally be in the filepath.
So I added this line of script and it works -
replace space with "%20" in tFile
So /Users/Documents/Some Folder/This Thing.PDF will not open in revBrowser but
/Users/Documents/Some%20Folder/This%20Thing.PDF will
Not sure why this is the case but at least it works. Any ideas?
Thanks. - Jorge
Re: revBrowserOpen Local PDF File
Hi Jorge,
yep, "replace SPACE with "%20" is the way to go 
 
But you also need to add the "file" keyword to the url like this:
...
replace space with "%20" in tFile
put "file://" & tFile into tUrl
put revBrowserOpen(the windowId of this stack,tUrl) into tBrowserId
...
Best
Klaus
			
			
									
									
						yep, "replace SPACE with "%20" is the way to go
 
 But you also need to add the "file" keyword to the url like this:
...
replace space with "%20" in tFile
put "file://" & tFile into tUrl
put revBrowserOpen(the windowId of this stack,tUrl) into tBrowserId
...
Best
Klaus
Re: revBrowserOpen Local PDF File
Got it.
Thanks for the follow-up Klaus.
Jorge
			
			
									
									
						Thanks for the follow-up Klaus.
Jorge