'Open In...' doc handling
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
'Open In...' doc handling
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
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
Urlwakeup should be sent with the local file URL
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: 'Open In...' doc handling
Thanks Monte
works a treat
Pi
works a treat
Pi
Re: 'Open In...' doc handling
No problem. If you want to send the Doc from your app to others then there's mergDoc or mergPop
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: 'Open In...' doc handling
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")
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
Hmm, not sure. Maybe try answer URL purl to show yourself the file contents and make sure there's data there.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/
Re: 'Open In...' doc handling
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
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
Nakia, how did you filter the pURL so the file was accessible?
Cheers
Gerry
Cheers
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: 'Open In...' doc handling
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..
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
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

Thanks
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
-
- VIP Livecode Opensource Backer
- Posts: 67
- Joined: Tue Jun 26, 2012 7:07 pm
Re: 'Open In...' doc handling
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
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