[Blog] Script Only Stacks

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[Blog] Script Only Stacks

Tim Bleiler
In the blog post, Mark states that "The fact that script only stack files really are just text files is really important! It means you can edit and create them in any text editor you choose, and use any text based processing tool on them…”

I’ve been trying to work with script only stacks on Mac OS X 10.11 for a few weeks now, at least since Livecode version 8 dp12. If I open one up in TextEdit and save it, Livecode gives me the error message: “Unable to open stack: File is not a stack”. The only way to recover the script has been to copy and paste it from the text editor into a new script only stack script. Additionally, I’ve never been able to create one in a text editor from scratch without getting the same error message from Livecode when I try to open it. I figure I must be doing something wrong because with the team using these all the time I don’t see how they wouldn’t have run into this. Any suggestions?


Tim Bleiler, Ph.D.
Instructional Designer, HSIT
University at Buffalo


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Peter TB Brett
On 03/03/2016 17:48, Tim Bleiler wrote:
> In the blog post, Mark states that "The fact that script only stack files really are just text files is really important! It means you can edit and create them in any text editor you choose, and use any text based processing tool on them…”
>
> I’ve been trying to work with script only stacks on Mac OS X 10.11 for a few weeks now, at least since Livecode version 8 dp12. If I open one up in TextEdit and save it, Livecode gives me the error message: “Unable to open stack: File is not a stack”. The only way to recover the script has been to copy and paste it from the text editor into a new script only stack script. Additionally, I’ve never been able to create one in a text editor from scratch without getting the same error message from Livecode when I try to open it. I figure I must be doing something wrong because with the team using these all the time I don’t see how they wouldn’t have run into this. Any suggestions?

The only thing I can think of to suggest is to make sure that your
editor is saving the file as UTF-16 text.

Usually script-only stacks start with a UTF-16 byte order mark.

                                Peter

--
Dr Peter Brett <[hidden email]>
LiveCode Open Source Team

LiveCode 2016 Conference https://livecode.com/edinburgh-2016/

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Tim Bleiler
Thanks Peter,

I gave that a try and I still get the same message. My attempts to create them from scratch were saved as UTF-8 and I’ve tried all the other options in TextEdit as well.  I have noticed  that if I open a functioning script only stack in ATOM it is identified as UTF-8.

Tim


> On Mar 3, 2016, at 1:12 PM, Peter TB Brett <[hidden email]> wrote:
>
> On 03/03/2016 17:48, Tim Bleiler wrote:
>> In the blog post, Mark states that "The fact that script only stack files really are just text files is really important! It means you can edit and create them in any text editor you choose, and use any text based processing tool on them…”
>>
>> I’ve been trying to work with script only stacks on Mac OS X 10.11 for a few weeks now, at least since Livecode version 8 dp12. If I open one up in TextEdit and save it, Livecode gives me the error message: “Unable to open stack: File is not a stack”. The only way to recover the script has been to copy and paste it from the text editor into a new script only stack script. Additionally, I’ve never been able to create one in a text editor from scratch without getting the same error message from Livecode when I try to open it. I figure I must be doing something wrong because with the team using these all the time I don’t see how they wouldn’t have run into this. Any suggestions?
>
> The only thing I can think of to suggest is to make sure that your editor is saving the file as UTF-16 text.
>
> Usually script-only stacks start with a UTF-16 byte order mark.
>
>                               Peter
>
> --
> Dr Peter Brett <[hidden email]>
> LiveCode Open Source Team
>
> LiveCode 2016 Conference https://livecode.com/edinburgh-2016/
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Richard Gaskin
Tim Bleiler wrote:
> Thanks Peter,
>
> I gave that a try and I still get the same message. My attempts to create them from scratch were saved as UTF-8 and I’ve tried all the other options in TextEdit as well.  I have noticed  that if I open a functioning script only stack in ATOM it is identified as UTF-8.

I wonder if it needs to use LC's native line ending, ASCII 10, rather
than ASCII 13 that many Mac tools use.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Matt Maier
I was just reading that the line endings can be different (because of
course they can).
http://www.hyperactivesw.com/cgitutorial/scripts1.html#trouble

*Make sure line endings in scripts are correct for the server platform. DOS
line endings are carriage return and linefeed. Unix line endings are a
single linefeed. Macintosh line endings are a single carriage return (but
note that scripts run by Apache in OS X require Unix line endings.)*
On Mar 3, 2016 10:39 AM, "Richard Gaskin" <[hidden email]>
wrote:

> Tim Bleiler wrote:
>
>> Thanks Peter,
>>
>> I gave that a try and I still get the same message. My attempts to create
>> them from scratch were saved as UTF-8 and I’ve tried all the other options
>> in TextEdit as well.  I have noticed  that if I open a functioning script
>> only stack in ATOM it is identified as UTF-8.
>>
>
> I wonder if it needs to use LC's native line ending, ASCII 10, rather than
> ASCII 13 that many Mac tools use.
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for the Desktop, Mobile, and the Web
>  ____________________________________________________________________
>  [hidden email]                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Tim Bleiler
In reply to this post by Richard Gaskin


> On Mar 3, 2016, at 1:38 PM, Richard Gaskin <[hidden email]> wrote:
>
> I wonder if it needs to use LC's native line ending, ASCII 10, rather than ASCII 13 that many Mac tools use.

Thanks Richard,

First, do you know of way to set this in TextEdit? I don’t see anything that can change that. Second, if that is the case, then the descriptions of how to use the script only files or how Livecode processes them probably will need to change. Should we call this a bug?

Tim
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Tore Nilsen
I think TextWrangler is a better choice than TextEdit for this purpose. In textWrangler you can specify both UTF 16 and Unix line endings.

Tore

> 3. mar. 2016 kl. 19.57 skrev Tim Bleiler <[hidden email]>:
>
>
>
>> On Mar 3, 2016, at 1:38 PM, Richard Gaskin <[hidden email]> wrote:
>>
>> I wonder if it needs to use LC's native line ending, ASCII 10, rather than ASCII 13 that many Mac tools use.
>
> Thanks Richard,
>
> First, do you know of way to set this in TextEdit? I don’t see anything that can change that. Second, if that is the case, then the descriptions of how to use the script only files or how Livecode processes them probably will need to change. Should we call this a bug?
>
> Tim
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Richard Gaskin
In reply to this post by Tim Bleiler
Tim Bleiler wrote:

 >> On Mar 3, 2016, at 1:38 PM, Richard Gaskin wrote:
 >>
 >> I wonder if it needs to use LC's native line ending, ASCII 10,
 >> rather than ASCII 13 that many Mac tools use.
 >
 > Thanks Richard,
 >
 > First, do you know of way to set this in TextEdit? I don’t see
 > anything that can change that.

I haven't used TextEdit in years, so I'm not sure what options it has
for setting line endings.  I tend to edit text in LC or a variety of
Linux tools, all which use the Unix convention of ASCII 10 for line endings.

 > Second, if that is the case, then the descriptions of how to use
 > the script only files or how Livecode processes them probably will
 > need to change. Should we call this a bug?

Let's find out if that's the issue first.  Does it work if you save the
file out of a field with binfile?

If so, it may be useful to note the line ending requirement.  Where is
that documentation?

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  [hidden email]                http://www.FourthWorld.com


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Robert Mann
In reply to this post by Tim Bleiler
I guess you checked that the first line is not empty and that there is no space before the first line?

"script" must be at the beginning of first line. Engine is very pick at that.

And sometimes the engine/ide adds another line at top, leading to 2 lines starting with "script"
so in the erasing process, by hand.. things can happen.
Robert
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Tim Bleiler
In reply to this post by Tore Nilsen

> On Mar 3, 2016, at 2:01 PM, Tore Nilsen <[hidden email]> wrote:
>
> I think TextWrangler is a better choice than TextEdit for this purpose. In textWrangler you can specify both UTF 16 and Unix line endings.
>

TextWrangler shows a working script only stacks as UTF-8, with BOM and Unix (LF).

A “broken” one shows UTF-8 and Unix (LF). So, the difference is BOM.

A discussion of with or without BOM can be found here:
http://stackoverflow.com/questions/2223882/whats-different-between-utf-8-and-utf-8-without-bom

I guess that leaves the question of whether this should remain a requirement of script only stacks or if the engine can be modified to accept without BOM.

Tim


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Monte Goulding-2
I know I have discussed this with Mark Waddingham before. I believe he was originally thinking of allowing other encodings at some point but was not averse to my suggestion of only supporting UTF8 with or without BOM.

Sent from my iPhone

> On 4 Mar 2016, at 6:17 AM, Tim Bleiler <[hidden email]> wrote:
>
> I guess that leaves the question of whether this should remain a requirement of script only stacks or if the engine can be modified to accept without BOM

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Tim Bleiler
It probably doesn’t matter much as long as it’s made clear what encodings are allowed. I would guess most users taking advantage of this feature could live with that. Casual users may be confused however, because most of us don’t give much thought to such details; a text file is a text file. Mark’s blog post doesn’t make any distinction either and implies any text file should work.

Tim


> On Mar 3, 2016, at 2:37 PM, Monte Goulding <[hidden email]> wrote:
>
> I know I have discussed this with Mark Waddingham before. I believe he was originally thinking of allowing other encodings at some point but was not averse to my suggestion of only supporting UTF8 with or without BOM.
>
> Sent from my iPhone
>
>> On 4 Mar 2016, at 6:17 AM, Tim Bleiler <[hidden email] <mailto:[hidden email]>> wrote:
>>
>> I guess that leaves the question of whether this should remain a requirement of script only stacks or if the engine can be modified to accept without BOM
>

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Jim Lambert
In reply to this post by Tim Bleiler
> TimB wrote:
> If I open one up in TextEdit and save it, Livecode gives me the error message: “Unable to open stack: File is not a stack”.

Hi Tim,
I’m not seeing that here with LC 8.0 (dp 15)

1. Launch TextEdit
2. File > New
3. Format > Make Plain Text
4. type

script "test2"
on openstack
answer "Wow!"
end openstack

5. File > Save
6. name it
“test2.livecode"  Use UTF-8 encoding
7. File > Close

8. Switch to LC
9. File > Open Stack…
10. Select “test2.livecode”
11. Answer dialog appears with “Wow!”

Jim Lambert


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Peter TB Brett
In reply to this post by Peter TB Brett
On 03/03/2016 18:12, Peter TB Brett wrote:

> On 03/03/2016 17:48, Tim Bleiler wrote:
>> In the blog post, Mark states that "The fact that script only stack
>> files really are just text files is really important! It means you can
>> edit and create them in any text editor you choose, and use any text
>> based processing tool on them…”
>>
>> I’ve been trying to work with script only stacks on Mac OS X 10.11 for
>> a few weeks now, at least since Livecode version 8 dp12. If I open one
>> up in TextEdit and save it, Livecode gives me the error message:
>> “Unable to open stack: File is not a stack”. The only way to recover
>> the script has been to copy and paste it from the text editor into a
>> new script only stack script. Additionally, I’ve never been able to
>> create one in a text editor from scratch without getting the same
>> error message from Livecode when I try to open it. I figure I must be
>> doing something wrong because with the team using these all the time I
>> don’t see how they wouldn’t have run into this. Any suggestions?
>
> The only thing I can think of to suggest is to make sure that your
> editor is saving the file as UTF-16 text.
>
> Usually script-only stacks start with a UTF-16 byte order mark.

And of course I have egg on my face because script-only stacks are
UTF-8, not UTF-16.  Thank you to everyone who corrected me!

                                       Peter

--
Dr Peter Brett <[hidden email]>
LiveCode Open Source Team

LiveCode 2016 Conference https://livecode.com/edinburgh-2016/

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Image Quality

Ralph DiMola
Am I missing something here on an images control?

If the LC prefs are set to "Property labels are: Name of LiveCode Property"

One of the labels for an image in the Property Inspector is "Quality". This is not an image property. The property is really named "resizequality". In the IDE if resizequality is set from the message box or script the image quality does not change unless you click on a tool or even hover over it until the tool tip appears. When the tool tip appears the image's quality obviously changes.

I think the label is a bug but is the IDE showing the quality change just a limitation?

LC 6.7.6

Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

LC8 IDE Parser

Ralph DiMola
In reply to this post by Peter TB Brett
First of all...Kudos to the Dev team for tightening up the IDE parser!!!

I had a library stack that would not compile because this is not allowed anymore "repeat while (1=1))" no complaints from LC6 but LC8(rightfully so) flags this as a compile error.  But this caused me some confusion. When the IDE loads the library stack from My Livecode/Plugins it failed to compile. The stack showed up in the project browser but not in the "stacksinuse". When I opened up my main stack the stack looked at stacksinuse and did not find the library stack and attempted to load it(for mobile) and I got the "there is already a stack named .... in memory" with the usual purge/cancel... dialog box. I was confused for a short while until I figured it out. I don’t know how to avoid this type of confusion but newbies would be scratching their heads for quite a while.


Ralph DiMola
IT Director
Evergreen Information Services
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Mark Waddingham-2
In reply to this post by Robert Mann
On 2016-03-03 19:43, Robert Mann wrote:

> I guess you checked that the first line is not empty and that there is
> no
> space before the first line?
>
> "script" must be at the beginning of first line. Engine is very pick at
> that.
>
> And sometimes the engine/ide adds another line at top, leading to 2
> lines
> starting with "script"
> so in the erasing process, by hand.. things can happen.

I guess my original intent of script only stacks was that they would be
created and edited in the IDE - so the fact that there is some strict
syntax to follow didn't really matter.

The main problem with allowing the syntax of script only stacks to be
more flexible is that any information before the very first line of
script in a script only stack (i.e. after the "script" line) would be
inaccessible from the engine.

The strictness means that - the implementation of script only stacks is
simple, and it guarantees that there is no non-code related 'churn' in
script only stack files. The latter is really important for VCS needs.

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Mark Waddingham-2
In reply to this post by Tim Bleiler
On 2016-03-03 20:45, Tim Bleiler wrote:
> It probably doesn’t matter much as long as it’s made clear what
> encodings are allowed. I would guess most users taking advantage of
> this feature could live with that. Casual users may be confused
> however, because most of us don’t give much thought to such details; a
> text file is a text file. Mark’s blog post doesn’t make any
> distinction either and implies any text file should work.

The current implementation in the engine uses the BOM to determine what
the encoding is - if there is no BOM then it assumes the native encoding
(e.g. MacRoman on Mac).

In terms of line endings, the engine converts all line endings to ASCII
10 (the universal LiveCode line ending). For reference these are:
    CR LF (ascii 13 then ascii 10 - default windows line endings)
    CR (ascii 13 - old-style Mac line endings)
    LF (ascii 10 - unix line endings)

So, it shouldn't matter what line endings the input file has, and
whether they are mixed or not.

I'm surprised lack of BOM in a simple script only stack would cause it
to fail to load... Tim, could you attach the script only stack files you
tried to create which fail to load to a bug report so we can take a
look?

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Tim Bleiler
In reply to this post by Jim Lambert
Thanks Jim,

Since you aren’t having the problem I tried a couple of other things. First, I had been dragging the file to the Livecode icon in the dock, so I tried opening it through the menu as you had done but I still get a file is not a stack message. I then shut my whole system down and tried everything again with the same result. So, it’s a bit mysterious.

Tim


> On Mar 3, 2016, at 3:22 PM, Jim Lambert <[hidden email]> wrote:
>
>> TimB wrote:
>> If I open one up in TextEdit and save it, Livecode gives me the error message: “Unable to open stack: File is not a stack”.
>
> Hi Tim,
> I’m not seeing that here with LC 8.0 (dp 15)
>
> 1. Launch TextEdit
> 2. File > New
> 3. Format > Make Plain Text
> 4. type
>
> script "test2"
> on openstack
> answer "Wow!"
> end openstack
>
> 5. File > Save
> 6. name it
> “test2.livecode"  Use UTF-8 encoding
> 7. File > Close
>
> 8. Switch to LC
> 9. File > Open Stack…
> 10. Select “test2.livecode”
> 11. Answer dialog appears with “Wow!”
>
> Jim Lambert


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: [Blog] Script Only Stacks

Tim Bleiler
In reply to this post by Mark Waddingham-2
Thanks Mark,

I submitted the file in bug report 17067.

Tim


> On Mar 4, 2016, at 5:38 AM, Mark Waddingham <[hidden email]> wrote:
>
> On 2016-03-03 20:45, Tim Bleiler wrote:
>> It probably doesn’t matter much as long as it’s made clear what
>> encodings are allowed. I would guess most users taking advantage of
>> this feature could live with that. Casual users may be confused
>> however, because most of us don’t give much thought to such details; a
>> text file is a text file. Mark’s blog post doesn’t make any
>> distinction either and implies any text file should work.
>
> The current implementation in the engine uses the BOM to determine what the encoding is - if there is no BOM then it assumes the native encoding (e.g. MacRoman on Mac).
>
> In terms of line endings, the engine converts all line endings to ASCII 10 (the universal LiveCode line ending). For reference these are:
>   CR LF (ascii 13 then ascii 10 - default windows line endings)
>   CR (ascii 13 - old-style Mac line endings)
>   LF (ascii 10 - unix line endings)
>
> So, it shouldn't matter what line endings the input file has, and whether they are mixed or not.
>
> I'm surprised lack of BOM in a simple script only stack would cause it to fail to load... Tim, could you attach the script only stack files you tried to create which fail to load to a bug report so we can take a look?
>
> Warmest Regards,
>
> Mark.
>
> --
> Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12