Page 1 of 1

Mobile Browser Widget Crashes

Posted: Tue Dec 22, 2020 1:22 am
by JereMiami
This is for android.

I have a pdf file called sample.pdf saved in specialFolderPath("documents"). I want to display it in the app. I suppose I have to use the browser widget.

But, when I script:

set the url of widget "browser" to specialFolderPath("documents") & "/sample.pdf"

-or-

set the url of widget "browser" to specialFolderPath("documents") & "sample.pdf"

Either way (forward slash or not) it crashes the app. Is that how I am supposed to do it? Any other way to display it?

Thanks!

Re: Mobile Browser Widget Crashes

Posted: Tue Dec 22, 2020 2:23 am
by Bernard
a) Does your PDF display in the browser widget if you run the code in the IDE?

b) try

Code: Select all

launch url "file:" & specialFolderPath("documents") & "/sample.pdf"
In the IDE this will at least test that there's nothing wrong with your path/filename or the PDF itself in relation to the widget. You could then try using "launch url" as above in the stack on Android.

Hopefully this can narrow down where the problem lies.

Re: Mobile Browser Widget Crashes

Posted: Tue Dec 22, 2020 9:24 pm
by JereMiami
It worked! Can't thank you enough.