Levure File_System

Find out what's going on with LiveCode (the company), product releases, announcements, and events.

Moderators: heatherlaine, Klaus, FourthWorld, robinmiller, kevinmiller

Post Reply
martyknapp
Posts: 28
Joined: Fri Mar 24, 2006 5:33 pm
Location: Blaine, Washington - USA

Levure File_System

Post by martyknapp » Thu Nov 08, 2018 4:20 am

I have the File System helper added to my app. My only need here is to associate the documents the app creates with the app so that they can be opened. I have confirmed that the helper is being added to the standalone and I have the app.yml file configured with a file extension:

file extensions:
CBP Files: cbp3

Then I added this to "OpenApplication" in the app.livecodescript stack:

if fileSystemFilesToProcessOnOpen() is not empty then
ProcessMyFiles fileSystemFilesToProcessOnOpen()
end if

and added to "ProcessFiles" in the app.livecodescript stack:
ProcessMyFiles pFiles

The instructions seemed to indicate the above should be added to the app.yml file but that didn't seem right to me and I assumed they belonged in app.livecodescript

With the app complied a double click on a document will launch the app but then I get a list of errors as follows:

573,52,1,ProcessMyFiles
253,52,1
241,51,1,OpenApplication
353,0,0,stack (then the path to app.livecodescript in the app)
675,567,1,levureFinishLoadingApplication
353,0,0,stack (then the path to levure.livecodescript in the app)

If the app is already launched and I double-click a document, it just brings the app to the front but the document does not open. I have obviously missed something here.

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 633
Joined: Fri Jun 27, 2008 9:00 pm

Re: Levure File_System

Post by Mikey » Thu Nov 08, 2018 3:04 pm

The first thing that jumped up at me was your file extensions key. Is CBP Files indented? It isn't in your post.

The error message (provided by Mikey's Error Handler helper, in case you need it) is:
Error:
- can't find handler
at char 1 in line 52
Hint: ProcessMyFiles
- error in statement
at char 1 in line 52
- error in statement
at char 1 in line 51
Hint: OpenApplication
- Name:

Hint: stack (then the path to app.livecodescript in the app)
- bad command
at char 1 in line 567
Hint: levureFinishLoadingApplication
- Name:

Hint: stack (then the path to levure.livecodescript in the app)
I'm pretty sure processMyFiles is a handler you have to write.
You are right about the references to app.yml being wrong.

martyknapp
Posts: 28
Joined: Fri Mar 24, 2006 5:33 pm
Location: Blaine, Washington - USA

Re: Levure File_System

Post by martyknapp » Thu Nov 08, 2018 7:01 pm

Just goes to show you what happens when you assume something! I thought the ProcessMyFiles was being handled. In my case replacing that with a simple go stack (line 1 of pFiles) does the trick.

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 633
Joined: Fri Jun 27, 2008 9:00 pm

Re: Levure File_System

Post by Mikey » Thu Nov 08, 2018 7:21 pm

When I read the README after your post, I could definitely see that. I fixed it and the other typos and issued a PR, so Trevor can update it.
There are several things going on in the Levure project to make writing and using helpers easier. Hopefully it will eventually become really really easy.

martyknapp
Posts: 28
Joined: Fri Mar 24, 2006 5:33 pm
Location: Blaine, Washington - USA

Re: Levure File_System

Post by martyknapp » Fri Nov 09, 2018 1:08 am

I'll have to say, I was reluctant to start working on this project to convert a project from the old GLX framework over to Levure, but it hasn't been nearly as hard as I thought. I'm very impressed with Levure and am totally excited to see it grow. Kudos to all who have helped make it happen.

Post Reply

Return to “Announcements”