Cannot add script only stack in Standalone Applications Settings
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Cannot add script only stack in Standalone Applications Settings
Using Indy 9.5.1 on Mac Catalina.
I have a main stack that uses several script only stacks. One of those stacks is set as the behaviour of the main stack. The others are used as needed. When creating a standalone, I want to add all those stacks to the Stacks area of Standalone Applications Settings. I can add all but the one stack that is used as the behaviour. The dialog box opens and it allows me to choose the behaviour stack but it is not then visible in the list of selected stacks.
Idea pls?
Kaveh
I have a main stack that uses several script only stacks. One of those stacks is set as the behaviour of the main stack. The others are used as needed. When creating a standalone, I want to add all those stacks to the Stacks area of Standalone Applications Settings. I can add all but the one stack that is used as the behaviour. The dialog box opens and it allows me to choose the behaviour stack but it is not then visible in the list of selected stacks.
Idea pls?
Kaveh
Kaveh
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Re: Cannot add script only stack in Standalone Applications Settings
Thanks Craig. That is a useful discussion. I solved my problem by adding the stacks in the "Add files" pane rather than the Stacks pane. I think as the stack was already set as the behaviour, it cannot be added again as a Stack.
Kaveh
-
- VIP Livecode Opensource Backer
- Posts: 9660
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cannot add script only stack in Standalone Applications Settings
Hmmm.I think as the stack was already set as the behaviour, it cannot be added again as a Stack.
This seems unlikely, or at least odd. Anyone know if it is true? And if so, why?
But in any case, were you able to include all the non-behavior stacks in the stack pane, and only this one in the file pane? Or did all go into the file pane?
That might answer the question I had above.
Craig
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Re: Cannot add script only stack in Standalone Applications Settings
All now in the files pane. And it is working ok. It is something I would like to understand more. If I have a script only stack, should it go in files or stacks. There was a comment by Jacque in the thread that you pointed to that it is files.
Kaveh
-
- VIP Livecode Opensource Backer
- Posts: 7233
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Cannot add script only stack in Standalone Applications Settings
Script-only files are text files, so they go in the "Copy Files" pane. They aren't binary, so the Stacks pane won't accept them.
When an app opens a script-only stack file, it creates a temporary stack (in RAM only) and puts the text of the file into the temporary stack script. From that point on, the stack behaves just like any other stack and you can treat it the same way. When the app closes, the temporary stack is destroyed. That's why script-ony stacks can't save properties or objects or anything else. But while the temporary stack is in use, you can assign properties, create objects, etc. and use them during the session as long as you're aware that when the session ends none of those changes will be saved. (An exception is when you're working in the IDE, which does save changes to the stack script, but nothing else.)
When an app opens a script-only stack file, it creates a temporary stack (in RAM only) and puts the text of the file into the temporary stack script. From that point on, the stack behaves just like any other stack and you can treat it the same way. When the app closes, the temporary stack is destroyed. That's why script-ony stacks can't save properties or objects or anything else. But while the temporary stack is in use, you can assign properties, create objects, etc. and use them during the session as long as you're aware that when the session ends none of those changes will be saved. (An exception is when you're working in the IDE, which does save changes to the stack script, but nothing else.)
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Re: Cannot add script only stack in Standalone Applications Settings
Thank you Jacqueline for the explanation. That makes sense. But what has been confusing me is that the Stacks pane in Standalone settings does accept all these script. Whether or not they are used or not I don't know but they show up in the Stacks area. The only exception is the script only stack that I have already set as the behaviour for the main stack. LiveCode still allows me to specify it through the dialog box but it does not show up in the list.
Anyway, all seems to be working by using the File area.
Anyway, all seems to be working by using the File area.
Kaveh
-
- VIP Livecode Opensource Backer
- Posts: 7233
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Cannot add script only stack in Standalone Applications Settings
Interesting. I've always assumed the files went into the Copy Files pane and I don't think I've tried adding them to the Stacks pane. Which is a long way of saying "I don't know why that happens."
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9660
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cannot add script only stack in Standalone Applications Settings
If I understand correctly, and I rarely do, several script-only stacks were accepted into the stacks pane, but the behavior one was not. All were eventually accepted into the files pane.
But is this in fact true? I am only interested academically, that assigning a behavior would change that.
Craig
But is this in fact true? I am only interested academically, that assigning a behavior would change that.
Craig
-
- Livecode Opensource Backer
- Posts: 508
- Joined: Sun Dec 18, 2011 7:23 pm
- Location: London
- Contact:
Re: Cannot add script only stack in Standalone Applications Settings
Hi Craig
Although the problem seems solved, good to get an understanding of what is going on as you say. Here is my code in my main stack:
So I set the behaviour first then call in all other script only stack needed.
When I add the script only stacks to the "stacks" area of Standalone Application Settings, I can add all stacks, except for the behaviour stack. For some reason it is not seeing that even though it is a simple script only stack. So it seems that the fact that the file has been set as the behaviour of the main stack is treated differently and cannot be added. Strange.
Although the problem seems solved, good to get an understanding of what is going on as you say. Here is my code in my main stack:
Code: Select all
local sLibraryPath
on preOpenStack
put specialfolderpath("resources") & "/script/MainFile_behaviour.livecodescript" \
into tBehaviour
set the behavior of stack "MainFile" to the long ID of stack tBehaviour
start using stack tBehaviour
--
put specialFolderPath("resources") & "/script/" into sLibraryPath
use_library "Lib_1" -- script only stacks
use_library "Lib_2"
...
use_library "Lib_n"
end preOpenStack
on use_library pStack
put pStack & ".livecodescript" into tStackName
put sLibraryPath & tStackName into tPath
open stack tPath
start using stack tPath
end use_library
When I add the script only stacks to the "stacks" area of Standalone Application Settings, I can add all stacks, except for the behaviour stack. For some reason it is not seeing that even though it is a simple script only stack. So it seems that the fact that the file has been set as the behaviour of the main stack is treated differently and cannot be added. Strange.
Kaveh
-
- VIP Livecode Opensource Backer
- Posts: 9660
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cannot add script only stack in Standalone Applications Settings
Since all the Standalone Settings are done by hand, I cannot see how any script can be pertinent.
I also cannot see how changing a property of a script-only stack can change its ability to live in the stack pane, regardless of whether that pane is the proper pane.
Anyone have any ideas?
Craig
I also cannot see how changing a property of a script-only stack can change its ability to live in the stack pane, regardless of whether that pane is the proper pane.
Anyone have any ideas?
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Cannot add script only stack in Standalone Applications Settings
A script-only stack has only a script, no properties.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 7233
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Cannot add script only stack in Standalone Applications Settings
Is there a reason to assign the script as a behavior and then also start using it? Typically behaviors are private to specific controls, while stacks in use are like backscripts that are in the message path for everything.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9660
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cannot add script only stack in Standalone Applications Settings
True. I misrepresented the word "property". It is that the behavior property was set that, er, sets this particular stack apart. And that is what baffles me; how do it know? Is it so?A script-only stack has only a script, no properties.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9834
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Cannot add script only stack in Standalone Applications Settings
Is the SoS being used as a behavior, or using something else as a behavior of its own?
I do believe an exception was added to the SoS definition to allow it to have its own behavior, declared in the second line of its text.
But either way, I'm not understanding the question.
I do believe an exception was added to the SoS definition to allow it to have its own behavior, declared in the second line of its text.
But either way, I'm not understanding the question.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn