copying image acros stacks doesn't work on Mac
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 40
- Joined: Thu May 17, 2018 7:32 pm
- Location: Florida, USA
copying image acros stacks doesn't work on Mac
I have an interesting one. In my startup code, I copy an image from one stack to another. The script is
copy image "imgSplash" of stack "stkDetails" to this card
In the IDE on both Mac and Windows, it works. In a windows standalone it works fine. But in a Mac standalone (either 32 or 64 bit) it does not. If I wrap it in a try/catch, there is no catch.
Has me flummoxed. Any ideas?
thanks!
mark
copy image "imgSplash" of stack "stkDetails" to this card
In the IDE on both Mac and Windows, it works. In a windows standalone it works fine. But in a Mac standalone (either 32 or 64 bit) it does not. If I wrap it in a try/catch, there is no catch.
Has me flummoxed. Any ideas?
thanks!
mark
Re: copying image acros stacks doesn't work on Mac
Hi Mark,
does it work if you proive the complete "address"?
...
copy image "imgSplash" of CARD "whatever" of stack "stkDetails" to this card
...
Best
Klaus
does it work if you proive the complete "address"?
...
copy image "imgSplash" of CARD "whatever" of stack "stkDetails" to this card
...
Best
Klaus
-
- Posts: 40
- Joined: Thu May 17, 2018 7:32 pm
- Location: Florida, USA
Re: copying image acros stacks doesn't work on Mac
No, it doesn't make any difference.
Re: copying image acros stacks doesn't work on Mac
Maybe the result will give a clue?
...
copy image "imgSplash" of CARD "whatever" of stack "stkDetails" to this card
answer the result
...
Maybe not...
...
copy image "imgSplash" of CARD "whatever" of stack "stkDetails" to this card
answer the result
...
Maybe not...
-
- Posts: 40
- Joined: Thu May 17, 2018 7:32 pm
- Location: Florida, USA
Re: copying image acros stacks doesn't work on Mac
I added "answer it" after the copy and in the IDE, I get a dialog box with the long name of the image where it was copied, just like the documentation says. On the Mac standalone, I get an empty dialog box.
Re: copying image acros stacks doesn't work on Mac
Also try "put the long id of <the image reference>" and/or "if there is an image <the image reference >" before you try to copy. You will hopefully get more clues as to what is wtong.
If it works in the IDE but not the standalone then it is most likely either a relative path issue or a standalone inclusions issue.
If it works in the IDE but not the standalone then it is most likely either a relative path issue or a standalone inclusions issue.
-
- Posts: 40
- Joined: Thu May 17, 2018 7:32 pm
- Location: Florida, USA
Re: copying image acros stacks doesn't work on Mac
Well, I added
answer the long id of image "imgSplash" of stack "stkDetails"
and in the IDE it points to the correct place. However, in the Mac Standalone, it does not.
It says "/users/markhinnebusch/Jazz/MacOSX/Jazz.app/Contents/MacOS/stkDetails.livecode"
BUT
the actual standalone app that was created has the structure:
/users/markhinnebusch/Jazz/MacOSX/Jazz.app/Contents/MacOS contains just the jazz executable. All of the other stacks are in
/users/markhinnebusch/Jazz/MacOSX/Jazz.app/Contents/Resources/_MacOS/Externals
so it should be looking for
/users/markhinnebusch/Jazz/MacOSX/Jazz.app/Contents/Resources/_MacOS/Externals/stkDetails.livecode
I guess I should have mentioned that I am using the splash screen method for updating standalones, so the Jazz stack includes the other stacks, including stkDetails.livecode.
answer the long id of image "imgSplash" of stack "stkDetails"
and in the IDE it points to the correct place. However, in the Mac Standalone, it does not.
It says "/users/markhinnebusch/Jazz/MacOSX/Jazz.app/Contents/MacOS/stkDetails.livecode"
BUT
the actual standalone app that was created has the structure:
/users/markhinnebusch/Jazz/MacOSX/Jazz.app/Contents/MacOS contains just the jazz executable. All of the other stacks are in
/users/markhinnebusch/Jazz/MacOSX/Jazz.app/Contents/Resources/_MacOS/Externals
so it should be looking for
/users/markhinnebusch/Jazz/MacOSX/Jazz.app/Contents/Resources/_MacOS/Externals/stkDetails.livecode
I guess I should have mentioned that I am using the splash screen method for updating standalones, so the Jazz stack includes the other stacks, including stkDetails.livecode.
-
- Posts: 40
- Joined: Thu May 17, 2018 7:32 pm
- Location: Florida, USA
Re: copying image acros stacks doesn't work on Mac
I just checked and this is the structure created for both 32 bit and 64 bit MacOS. Exactly the same results.
I am running Livecode Business 8.1.8
I tried to upgrade to 9 but the upgrade failed, so I just stayed on 8.1.8 but I can't believe that no one else has tried to do what I am doing.
I am running Livecode Business 8.1.8
I tried to upgrade to 9 but the upgrade failed, so I just stayed on 8.1.8 but I can't believe that no one else has tried to do what I am doing.
Re: copying image acros stacks doesn't work on Mac
Yes! Get used to specialFolderPath("resources") - this is where you will find all files and folders included in the standalone settings. It works on all architectures and is intended to reference "resource" files for this exact reason.
It is a read only location on most platforms. And loads of people do it this way.
It is a read only location on most platforms. And loads of people do it this way.
Re: copying image acros stacks doesn't work on Mac
Hi Mark,
if you added your stacks/files/whatever to your standalone via the "Copy files" tab in the "Standalone Application Settings", you will find it, as SparkOut mentioned, in your standalone here:
specialfolderpath("resources")
This pathname is very unlikely, unless you copied your stuff manually into the final application package.
Klaus
P.S.
The infos you provided after FIVE replies should have gone into your initial post.
if you added your stacks/files/whatever to your standalone via the "Copy files" tab in the "Standalone Application Settings", you will find it, as SparkOut mentioned, in your standalone here:
specialfolderpath("resources")
This pathname is very unlikely, unless you copied your stuff manually into the final application package.
Best/users/markhinnebusch/Jazz/MacOSX/Jazz.app/Contents/Resources/_MacOS/Externals
Klaus
P.S.
The infos you provided after FIVE replies should have gone into your initial post.
-
- Posts: 40
- Joined: Thu May 17, 2018 7:32 pm
- Location: Florida, USA
Re: copying image acros stacks doesn't work on Mac
I put the other stacks, including stkDetails, under the Stacks tab in the standalone builder for Jazz.livecode. That seemed intuitive. I also tried putting them in copy files before coming to the forum but it still didn't see them.
So, I guess I'm quite confused. How would I use specialfolderpath("resources") in my code? I want to
copy image "imgSplash" of stack "stkDetails" to this card
Do I need to qualify stkDetails with specialfolderpath("resources")? I couldn't find any examples of doing that.
So, I guess I'm quite confused. How would I use specialfolderpath("resources") in my code? I want to
copy image "imgSplash" of stack "stkDetails" to this card
Do I need to qualify stkDetails with specialfolderpath("resources")? I couldn't find any examples of doing that.
-
- Posts: 40
- Joined: Thu May 17, 2018 7:32 pm
- Location: Florida, USA
Re: copying image acros stacks doesn't work on Mac
OH, wait. I think I got it. I use the stackFiles instruction in the openStack for jazz.livecode and put the references to all of the other stacks with their file names, using the SpecialFolder. Is that correct?
Re: copying image acros stacks doesn't work on Mac
Hi Mark,
since a file on disk can consist of one mainstack and zero to N substacks, "the stackfiles" is a list so LC knows what stack is saved in what FILE. The name of the stack does not have to match its filename!
So I would try this:
If the image is in a SUBSTACK of that stackfile:
Best
Klaus
since a file on disk can consist of one mainstack and zero to N substacks, "the stackfiles" is a list so LC knows what stack is saved in what FILE. The name of the stack does not have to match its filename!
So I would try this:
Code: Select all
...
put specialfolderpath("resources") & "/stkDetails.livecode" into tStack
copy image "imgSplash" of cd X of stack tStack to this card
...
Code: Select all
...
put specialfolderpath("resources") & "/stkDetails.livecode" into tStack
copy image "imgSplash" of cd X of stack "name of your substack here..." of stack tStack to this card
...
Klaus
-
- Posts: 40
- Joined: Thu May 17, 2018 7:32 pm
- Location: Florida, USA
Re: copying image acros stacks doesn't work on Mac
Klaus,
Thank you so much. I wasn't aware that you could fully qualify the stack in that manner. It solves all of my problems (well, at least the ones that I know of).
-mark
Thank you so much. I wasn't aware that you could fully qualify the stack in that manner. It solves all of my problems (well, at least the ones that I know of).
-mark
Re: copying image acros stacks doesn't work on Mac
Glad I could help!