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

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

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

Post by Emily-Elizabeth »

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.
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: [REQ] macOS Document Packages in LC 9.6.3

Post by FourthWorld »

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
Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

Re: [REQ] macOS Document Packages in LC 9.6.3

Post 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"
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: [REQ] macOS Document Packages in LC 9.6.3

Post by FourthWorld »

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
Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

Re: [REQ] macOS Document Packages in LC 9.6.3

Post 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.
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: [REQ] macOS Document Packages in LC 9.6.3

Post 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
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Emily-Elizabeth
Posts: 205
Joined: Mon Jan 03, 2022 7:10 pm
Contact:

Re: [REQ] macOS Document Packages in LC 9.6.3

Post 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 :-)
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

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

Post by FourthWorld »

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
PaulDaMacMan
Posts: 683
Joined: Wed Apr 24, 2013 4:53 pm
Contact:

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

Post 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).
My GitHub Repos: https://github.com/PaulMcClernan/
Related YouTube Videos: PlayList
Post Reply