opening a pdf NOT using opendialog

bob76's icon

basically, I want the file to just pop open on a click, but can only make it offer a file location with opendialog. Is there another object that can make pdfs open on screen with no user choice so that the same one always opens?

Luke Hall's icon

If you are using a mac and know the path to the document you want to open you can use the [shell] external (google or maxobjects.com will help you find it, the UB version is probably the one you need). Send it a message formatted:

cd ~/Desktop; open "target file.pdf"

If you want the file to open with a specific application, rather than the default you can format it like this:

cd ~/Desktop; open -a TextEdit "index.html"

The first path needs to be the containing folder and the end bit is the filename.

lh

Thomas Sandberg's icon

You can also do it The Applescript Way, also using the shell object.
Then you can define which application you will use for opening the PDF.

Max Patch
Copy patch and select New From Clipboard in Max.

/Thomas

bob76's icon

thanks guys

love this forum...

pid's icon

am i missing something? probably...

Max Patch
Copy patch and select New From Clipboard in Max.

i just use the classic maxbrowser command:

...pretty easy to adapt to specify a path other than the patch path.

i mean, all the other methods are great too, of course...

Thomas Sandberg's icon

the maxbrowser trick is very nice too !
isnt it just fantastic that the same thing can be done in sooooo many ways in max ?

Hans Höglund's icon

Or use the built-in browser object.

Max Patch
Copy patch and select New From Clipboard in Max.

bob76's icon
Max Patch
Copy patch and select New From Clipboard in Max.

To pid - I tried yours and it worked a treat, but it wont open the file when I turn it into an application. Did I do something wrong?

pid's icon

@bob76: i'm afraid i have no idea, as applications are not my strong point. but presumably they have 'root' as themselves, as it were. try including the pdf in the app and not using the 'path' command to 'thispatcher' but simply the known path to the folder structure of the app?

others will be able to give more help no doubt.

jazzisfaction's icon

A couple of days ago AD. posted this zip for the shell object on the forum...if you need it

the first one is the right one ;-)

621.Shell_UB.zip
zip
bob76's icon

All working - thanks for the shell zip - that was just what I needed.

arronlee's icon

I wonder whether the PDF files can be opened using some manual PDF readers built with the help of some manual tools which can be customized by users according to our own favors to help open and view PDF files? Any ideas?

Best regards,
Arron

dhimage's icon

right, pdf related software such as pdf reader, pdf viewer or other applications can be used to open pdf document. external software or built in application.

geckohooks's icon

Would love to use jweb for this @HANSHÖGLUND, but it doesn't open PDFs for me. Does anyone else have this problem?

@BOB76 and @PID, thanks for your suggestions for maxbrowser; however when I use this technique I get the following error:

Max could not launch URL. err = -43

I'm using Max 7 on a 2014 Macbook Pro OSX 10.9.5; if this makes a difference.

narner's icon

Has anyone done something exactly like this, but in Windows, not Mac? And that will work in an application?