[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: 41
Joined: Mon Jan 03, 2022 7:10 pm

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

Post by Emily-Elizabeth » Mon Dec 19, 2022 10:34 pm

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: 9513
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: [REQ] macOS Document Packages in LC 9.6.3

Post by FourthWorld » Tue Dec 20, 2022 1:03 am

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: 41
Joined: Mon Jan 03, 2022 7:10 pm

Re: [REQ] macOS Document Packages in LC 9.6.3

Post by Emily-Elizabeth » Tue Dec 20, 2022 1:06 am

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: 9513
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: [REQ] macOS Document Packages in LC 9.6.3

Post by FourthWorld » Tue Dec 20, 2022 1:48 am

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: 41
Joined: Mon Jan 03, 2022 7:10 pm

Re: [REQ] macOS Document Packages in LC 9.6.3

Post by Emily-Elizabeth » Tue Dec 20, 2022 1:59 am

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: 9513
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: [REQ] macOS Document Packages in LC 9.6.3

Post by FourthWorld » Tue Dec 20, 2022 2:25 am

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: 41
Joined: Mon Jan 03, 2022 7:10 pm

Re: [REQ] macOS Document Packages in LC 9.6.3

Post by Emily-Elizabeth » Tue Dec 20, 2022 2:51 am

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: 9513
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

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

Post by FourthWorld » Tue Dec 20, 2022 5:34 am

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

Post Reply

Return to “Mac OS”