Plug-in stack script not surviving sessions

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9656
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Plug-in stack script not surviving sessions

Post by dunbarx » Wed Oct 31, 2018 3:04 pm

I have a plug-in that has two handlers in the stack script.

But now I cannot save any additional handlers to the stack script between sessions. The original pair of handlers, that I made when I first built the plug-in, always survives.

Nothing obvious, like the "cantModify" or anything like that. How does the stack script know to keep the handlers made long ago, but not any new ones? Is it just me?

Craig Newman

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9656
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Plug-in stack script not surviving sessions

Post by dunbarx » Wed Oct 31, 2018 3:19 pm

Well.

It seems that only trying to add a "saveStackRequest" handler to the plug-in stack script fails to save between sessions. That was the message I was trying to catch. Others seem to have no issue staying in the script.

But the entire "saveStackRequest" handler disappears between sessions.

Craig

Klaus
Posts: 13823
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Plug-in stack script not surviving sessions

Post by Klaus » Wed Oct 31, 2018 6:59 pm

Hi Craig,

1. How do you save that stack? Via menu (CMD-S) or via script?
2. If the latter, what does "the result" show you after you issue your "save" command?
3. Does this also happen, if you quit LC, take the stack out of the plugin folder and edit it as a "regular" stack? That's what I would try first.


Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9656
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Plug-in stack script not surviving sessions

Post by dunbarx » Wed Oct 31, 2018 9:46 pm

Klaus.

Hi.

I save by CMD-S.

So I added a button and saved via a short handler. The result is empty.

I took the plug-in out of the plugin folder, added a saveStackRequest handler, saved everything and quit LC.

When I reopened, the new handler was not there. I can add other handlers, and they stick just fine. It seems it is just "saveStackRequest".

Craig

Klaus
Posts: 13823
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Plug-in stack script not surviving sessions

Post by Klaus » Wed Oct 31, 2018 10:02 pm

Hm, very strange...

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Plug-in stack script not surviving sessions

Post by bwmilby » Wed Oct 31, 2018 10:57 pm

Do you end it with a pass? If you intercept the saveStackRequest then you abort the save I believe.
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9656
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Plug-in stack script not surviving sessions

Post by dunbarx » Wed Oct 31, 2018 11:51 pm

Do you end it with a pass? If you intercept the saveStackRequest then you abort the save I believe.
Yes I do, but a good point.

But my issue is not that I cannot save a stack, even the plugin stack. It is that the "saveStackRequest" handler itself will not survive sessions in my plugin stack script. No problem with a "rawKeyUp" handler, which does most of what that plugin is for. I have added several other handlers, just to test. They all stick.

It is a problem with that specific handler, "saveStackRequest". It just does not stick in a new session.

I do not know if there is something about that particular plugin, but I cannot imagine why, since other handlers have no problems at all.

Craig

EDIT. Restarting the machine does not help.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9656
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Plug-in stack script not surviving sessions

Post by dunbarx » Fri Nov 02, 2018 7:07 pm

No comments for a while.

I will sent the stack to the team and see what they make of it.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Plug-in stack script not surviving sessions

Post by FourthWorld » Fri Nov 02, 2018 7:11 pm

This shouldn't matter, but we're dealing with unknowns so better to be thorough: are you able to add that handler to the stack script if it is opened from a location other than the Plugins folder?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Klaus
Posts: 13823
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Plug-in stack script not surviving sessions

Post by Klaus » Fri Nov 02, 2018 7:18 pm

FourthWorld wrote:
Fri Nov 02, 2018 7:11 pm
This shouldn't matter, but we're dealing with unknowns so better to be thorough: are you able to add that handler to the stack script if it is opened from a location other than the Plugins folder?
http://forums.livecode.com/viewtopic.ph ... 04#p172790

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Plug-in stack script not surviving sessions

Post by FourthWorld » Fri Nov 02, 2018 8:16 pm

Is this reproducible with another stack file?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bwmilby
Posts: 438
Joined: Wed Jun 07, 2017 5:37 am
Location: Henrico, VA
Contact:

Re: Plug-in stack script not surviving sessions

Post by bwmilby » Fri Nov 02, 2018 8:25 pm

I think we need to see more of the handler in question.

What about the following:

Code: Select all

on saveStackRequest
   pass saveStackRequest
end saveStackRequest
Brian Milby

Script Tracker https://github.com/bwmilby/scriptTracker

Post Reply

Return to “Talking LiveCode”