[REQ] macOS Document Packages in LC 9.6.3 [solved]
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 61
- Joined: Mon Jan 03, 2022 7:10 pm
[REQ] macOS Document Packages in LC 9.6.3 [solved]
Is there a way to create and use (read from, etc) document packages (bundles) in LC 9.6.3 (Community edition)?
Last edited by Emily-Elizabeth on Tue Dec 20, 2022 2:52 am, edited 1 time in total.
-
- VIP Livecode Opensource Backer
- Posts: 9548
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: [REQ] macOS Document Packages in LC 9.6.3
The packages themselves are just Zip files, yes? The revZip external should let you get to the parts you want.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 61
- Joined: Mon Jan 03, 2022 7:10 pm
Re: [REQ] macOS Document Packages in LC 9.6.3
The packages are folders with a file extension, that are recognized by the operating system, and get treated as a single file (even though you can have multiple files inside of it). An example is in the Pictures folder "Photos Library.photoslibrary"
-
- VIP Livecode Opensource Backer
- Posts: 9548
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: [REQ] macOS Document Packages in LC 9.6.3
Uncompressed folders should be even easier to traverse. What do you want to do?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 61
- Joined: Mon Jan 03, 2022 7:10 pm
Re: [REQ] macOS Document Packages in LC 9.6.3
Create the document package from LiveCode so I can store the two needed files in there.
where the "Saved File.DatabaseDesigner" is the 'file' (folder) that the end user interacts with.
Code: Select all
~/Saved File.DatabaseDesigner/Saved File.dbd
~/Saved File.DatabaseDesigner/Saved File.sqlite
-
- VIP Livecode Opensource Backer
- Posts: 9548
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: [REQ] macOS Document Packages in LC 9.6.3
I believe all you'd need to do to register the folder as a package is to add the appropriate entry in your app's plist:
https://developer.apple.com/library/arc ... kages.html
https://developer.apple.com/library/arc ... kages.html
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 61
- Joined: Mon Jan 03, 2022 7:10 pm
Re: [REQ] macOS Document Packages in LC 9.6.3
Okay, so I needed to set the Document Extension, in the standalone builder settings

and then add the following to the Info.plist file (in the application's bundle).

It didn't take effect right away, until I used the "ask file" command and then it showed the package as a file instead of a folder.
Now to update my code to handle this

and then add the following to the Info.plist file (in the application's bundle).
Code: Select all
<key>LSTypeIsPackage</key>
<integer>1</integer>

It didn't take effect right away, until I used the "ask file" command and then it showed the package as a file instead of a folder.
Now to update my code to handle this

-
- VIP Livecode Opensource Backer
- Posts: 9548
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: [REQ] macOS Document Packages in LC 9.6.3 [solved]
Super cool. I always like your posts and replies, always with helpful details.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn