Page 1 of 1

Browser widget with included folder

Posted: Tue Aug 25, 2020 8:53 pm
by Batninja
Hello

Has anyone managed to get a folder with HTML files included into an IOS app and accessed with the browser widget?

I have included a folder called "iac" in the standalone settings that has an idex.html file and other content. It works fine with a direct path to the index.html file on my local drive in the browser widget URL but I cannot get the IOS app to find the included version.

The code I'm using is

Code: Select all

on mouseUp
   put "file://" & specialfolderpath("engine") & "/iac/index.html" into file1
   set the url of widget "Browser" to file1
end mouseUp
I've tried with/without file: and various combinations of slashes without any luck.

Any help would be appreciated. :-)

Re: Browser widget with included folder

Posted: Wed Aug 26, 2020 11:28 am
by simon.schvartzman
HI, I guess the specialfolderpath has to be "documents" instead of "engine" when deploying to iOS/mobile.

HTH

Best

Re: Browser widget with included folder

Posted: Thu Aug 27, 2020 4:06 pm
by Klaus
Get used to use -> specialfolderpath("resources")
That happens to be the same as -> specialfolderpath("engine")
on iOS, but only on iOS and Android!

Try this, and please use the CODE tags after pasting your LC script(s) here:

Code: Select all

on mouseUp
  put "file://" & specialfolderpath("resources") & "/iac/index.html" into file1

  ## We have to avoid SPACES in the pathname for URLs:
  replace " " with "%20" in file1
  set the url of widget "Browser" to file1
  
  ## Check for success and maybe get a hint why it failed if it did:
  if the result <> EMPTY then
     answer "Error:" & CR & the result
  end if
end mouseUp

Re: Browser widget with included folder

Posted: Fri Aug 28, 2020 10:26 am
by Batninja
Thank so much Klaus for helping out with our code sample, it worked perfectly and runs fine on my iPhone 6s.

Thanks as well for the code tags advice, I fixed my original post :)