Page 1 of 1

'Open In...' doc handling

Posted: Fri Jan 04, 2013 2:22 pm
by seaniepie
Hi all,

I'm working on a plan to have a doc open from safari into myApp using the Open In/With dialogue. By hacking the 'Settings.plist' files in /Applications/LiveCode 5.5.3.app/Contents/Tools/Runtime/iOS I can add in the file association (filetype) for the doc types I am trying to handle.

What I need to work out now is what happens when someone tries to open the doc from Safari into myApp. How does myApp know that it is being handed a file? Does anyone here have some experience with this?

Thanks in advance.

Pi

Re: 'Open In...' doc handling

Posted: Sat Jan 05, 2013 2:51 am
by monte
Urlwakeup should be sent with the local file URL

Re: 'Open In...' doc handling

Posted: Sat Jan 05, 2013 3:13 am
by seaniepie
Thanks Monte
works a treat
Pi

Re: 'Open In...' doc handling

Posted: Sat Jan 05, 2013 10:01 pm
by monte
No problem. If you want to send the Doc from your app to others then there's mergDoc or mergPop

Re: 'Open In...' doc handling

Posted: Fri Feb 01, 2013 9:48 am
by Nakia
Is there any reason I cant just do a mergShowDocPreview pURL using urlWakeUp pURL?
When I do this the preview never loads..

Is this because pURL contains the full file path and doesn't use specialFolderPaths etc?
also
I am using this following line to save the file but it has no size when it creates the file
put URL pURL into URL ("file://" & specialFolderPath(Documents) & "/Completed/Commissions/" & tUnit & "-" & tDate & ".doc")

Re: 'Open In...' doc handling

Posted: Fri Feb 01, 2013 10:21 am
by monte
Hmm, not sure. Maybe try answer URL purl to show yourself the file contents and make sure there's data there.

Re: 'Open In...' doc handling

Posted: Fri Feb 01, 2013 10:59 am
by Nakia
Hmm, yeah it didn't seem to like the full file name (localhost/var/appid/docs/inbox etc etc)
A bit of filtering on pURL and it all works fine now but it was a bit of a PITA

Re: 'Open In...' doc handling

Posted: Wed Feb 20, 2013 3:43 am
by Jellicle
Nakia, how did you filter the pURL so the file was accessible?

Cheers

Gerry

Re: 'Open In...' doc handling

Posted: Fri Feb 22, 2013 10:15 am
by Nakia
Hi Gerry,

Not at the computer right now but from memory I think I just used some chunk expressions
to get the file name out of pURL and from there made the observation that the files are always placed in the
Same folder (Documents/Inbox from memory) so just referenced that when using the file..

Re: 'Open In...' doc handling

Posted: Sat Feb 23, 2013 2:38 am
by Jellicle
Ahhhh. For some reason I thought the attachment I was after was not in my app's directory. I just didn't read the URL properly. Silly me. Ok, it's trivial now :)

Thanks

Gerry

Re: 'Open In...' doc handling

Posted: Thu Feb 28, 2013 5:36 pm
by williamdesmet
Hi, can you tell me how you did this exactly?
When I follow your suggestion I still have to choose a folder (Device or Simulator) before I see the Settings.plist.
And when I try to open the .plst in Xcode I get an error "The data couldn't be read because it has been corrupted".
I never touched this file before.
Doesn't make a difference for LC 5.5.3. or LC 5.5.4.
I am on OS X 10.8.2.

Greetings,

William