Page 1 of 1

[REQ] macOS Document Packages in LC 9.6.3 [solved]

Posted: Mon Dec 19, 2022 10:34 pm
by Emily-Elizabeth
Is there a way to create and use (read from, etc) document packages (bundles) in LC 9.6.3 (Community edition)?

Re: [REQ] macOS Document Packages in LC 9.6.3

Posted: Tue Dec 20, 2022 1:03 am
by FourthWorld
The packages themselves are just Zip files, yes? The revZip external should let you get to the parts you want.

Re: [REQ] macOS Document Packages in LC 9.6.3

Posted: Tue Dec 20, 2022 1:06 am
by Emily-Elizabeth
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"

Re: [REQ] macOS Document Packages in LC 9.6.3

Posted: Tue Dec 20, 2022 1:48 am
by FourthWorld
Uncompressed folders should be even easier to traverse. What do you want to do?

Re: [REQ] macOS Document Packages in LC 9.6.3

Posted: Tue Dec 20, 2022 1:59 am
by Emily-Elizabeth
Create the document package from LiveCode so I can store the two needed files in there.

Code: Select all

~/Saved File.DatabaseDesigner/Saved File.dbd
~/Saved File.DatabaseDesigner/Saved File.sqlite
where the "Saved File.DatabaseDesigner" is the 'file' (folder) that the end user interacts with.

Re: [REQ] macOS Document Packages in LC 9.6.3

Posted: Tue Dec 20, 2022 2:25 am
by FourthWorld
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

Re: [REQ] macOS Document Packages in LC 9.6.3

Posted: Tue Dec 20, 2022 2:51 am
by Emily-Elizabeth
Okay, so I needed to set the Document Extension, in the standalone builder settings
Image
and then add the following to the Info.plist file (in the application's bundle).

Code: Select all

<key>LSTypeIsPackage</key>
<integer>1</integer>
Image
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 :-)

Re: [REQ] macOS Document Packages in LC 9.6.3 [solved]

Posted: Tue Dec 20, 2022 5:34 am
by FourthWorld
Super cool. I always like your posts and replies, always with helpful details.

Re: [REQ] macOS Document Packages in LC 9.6.3 [solved]

Posted: Wed Jul 12, 2023 9:35 pm
by PaulDaMacMan
Just to clarify, macOS Packages (.pkg) are installer files, which isn't the same as a bundle (but also comes from Mac OS X's NeXTstep legacy). Pkg files are often compressed file (but may also be bundles).