Initializing Libraries

Sannyasin Brahmanathaswami brahma at hindu.org
Sun Jul 24 23:56:54 EDT 2016


True: you can make the file association on hour mac (document/application binding) for .livecodescript/Livecode

but LC handles it differently

lf you use just use

someStack.livecode

when you open the "stack" (script only) it actually instantiates a window in the IDE that you can then do cmd-K and it auto opens the script. 

if you double click on the someStack.livecodescript from the finder, it *does* now appear in the open windows (hence it must be in RAM) but there is no stack window as such in the IDE for a .livecodescript stack…so I'm unable to edit this from inside the IDE.

This presents a caveat (I think) if you were to edit that stack on disk… there is no way to ensure the stack by the same name in the IDE has the new code. I could be wrong, but

open from disk  someStack.livecodescript → now in RAM
edit someSTack.LiveCodescript  with text editor… your changes are not live.

this was causing me a lot of grief… so I changed them to ".livecode" and now open them in the IDE, edit and save.. and now, the code in RAM for that stack is also getting a live update.  Because all open stack that have that backscript( for an example) can access any new handlers or changes you just made… But this does not appear to be the case when you edit a .livecodescript on disk.

This is a bit of a snakepit… one day I'll get it all sorted. A guide would be great.

POINT/QUESTION: Your list:

insert the script of stack tStackPath into front
set the behavior of btn x to the long ID of stack tStackPath
start using stack tStackPath
get the cMyProp of stack tStackPath

is very useful… but if you have already done any of these and then edit the script only stack on disk… what is the status of that change? Does the IDE know about the change? I don't think so.

On think I know for sure… if you edit a file on disk while you have that somestack.livecode open in the ID.. then save the stack open in the ID, it does wipe out your edits on disk… ergo, I'm pretty sure editing on disk will *not* be recognized by the ID… 

BR (still fumbling badly to find best practices….)

-------------

 

On 7/23/16, 11:29 AM, "use-livecode on behalf of J. Landman Gay" <use-livecode-bounces at lists.runrev.com on behalf of jacque at hyperactivesw.com> wrote:

    >but if you use ".livecodescript" as the extension. then you can't
    >actually open it in the IDE by double clicking.
    >
    >I not that the livecode IDE uses ".livecodescript" for behaviors
    >
    >is there a best practices concept here that may help us?  What has
    >the team discovered and "why"
    
    This is an OS association. On Mac, use the Get Info window on any 
    livecodescript stack and "open with" the version of LC you're using. 
    Click the checkbox to apply that association to all files of that type.



More information about the use-livecode mailing list