How to make a referenced image part of the stack
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How to make a referenced image part of the stack
Hello again,
I like to use referenced images during the process of design and programming.
But when it come to the standalone version. I like to have the referenced images part of the stack, so that there is no extra folder with the images, which can be deleted and distort the look of the program.
What is the best way to do so?
Have a good weekend.
Jens
P.S. I can enter any folder name in "destination folder" in Copy Files, but I always find the original folder name in the windows folder with the standalone program. It's a bug in 5.5.?
P.P.S.: Which is the best grafic program to use with livecode? I like adobe fireworks (on mac) most.
Is there a other program like fireworks for win, which can handle .png in the same way?
I like to use referenced images during the process of design and programming.
But when it come to the standalone version. I like to have the referenced images part of the stack, so that there is no extra folder with the images, which can be deleted and distort the look of the program.
What is the best way to do so?
Have a good weekend.
Jens
P.S. I can enter any folder name in "destination folder" in Copy Files, but I always find the original folder name in the windows folder with the standalone program. It's a bug in 5.5.?
P.P.S.: Which is the best grafic program to use with livecode? I like adobe fireworks (on mac) most.
Is there a other program like fireworks for win, which can handle .png in the same way?
Re: How to make a referenced image part of the stack
Hi Jens,
I have a little script for exact that purpose!
I use referenced images, so you can excahnge and modify them during development
and then import them before building a standalone.
You could even add this to a "savingstandalone" handler, see dictionary, of your main-/standalone stack!
It simply loops through all your cards in a give stack and will "import! all referenced iamges:
P.S.
No bug!
That's the way it works, all the files and folders will be copied to the folder
where the runtime sits, which is not so cute on Windows where you can see
all the files and folders, as on the Mac where everything goe nicely into the
application package!
I'm not sure what you are exspecting?
P.S.
If you need to do graphic work on Windows, too, there is also FireWorks for Windows
I do all my graphics work on my Mac
Best
Klaus
I have a little script for exact that purpose!
I use referenced images, so you can excahnge and modify them during development
and then import them before building a standalone.
You could even add this to a "savingstandalone" handler, see dictionary, of your main-/standalone stack!
It simply loops through all your cards in a give stack and will "import! all referenced iamges:
Code: Select all
command import_referenced_images
set the defaultstack to "Name of your stack here!"
lock screen
lock messages
repeat with i = 1 to the num of cds
set cursor to busy
repeat with k = 1 to the num of images of cd i
get the filename of image k of cd i
if it = empty then
next repeat
end if
put url("binfile:" & it) into image k of cd i
end repeat
end repeat
unlock screen
unlock messages
end import_referenced_images
No bug!
That's the way it works, all the files and folders will be copied to the folder
where the runtime sits, which is not so cute on Windows where you can see
all the files and folders, as on the Mac where everything goe nicely into the
application package!
I'm not sure what you are exspecting?
P.S.
If you need to do graphic work on Windows, too, there is also FireWorks for Windows

I do all my graphics work on my Mac

Best
Klaus
Re: How to make a referenced image part of the stack
Allegra Klaus,
thanks for your answer. But it doesn't not work.
I tried this:
A image with a path like "/Users/jens105/Desktop/unterordner/bild1.png" will shown in my stack, but a path like "./unterordner/bild1.png" not.
The second path will be generate by your script and so i will loose all images.
P.S. When I can name a destination folder "referenced files" I expect that all ref. files will be in that folder (like InDesign collect all files in a folder called "link). Silly me?
P.P.S. I know that fireworks is on Windows too, but the program is not free at all. Can't believe that there is no other program, hat can work with .png like Fireworks.
Have a good weekend.
Jens
thanks for your answer. But it doesn't not work.
I tried this:
Code: Select all
put field "fPfad" into tPath # get the path of an image (i.e. with answer file)
put empty into image 1 # clear the image
put url ("binfile:" & tPath) into image 1 # take the new image
put tPath into field "fPfad" # show the path for testing
The second path will be generate by your script and so i will loose all images.
P.S. When I can name a destination folder "referenced files" I expect that all ref. files will be in that folder (like InDesign collect all files in a folder called "link). Silly me?
P.P.S. I know that fireworks is on Windows too, but the program is not free at all. Can't believe that there is no other program, hat can work with .png like Fireworks.
Have a good weekend.
Jens
Re: How to make a referenced image part of the stack
Fireworks for mac is not free also (like for win). You asked for "best graphic program" - it'll be never free.
Marek
Marek
Re: How to make a referenced image part of the stack
Hi Jens,
But you could do this before the repeat loop:
Out of my head, but you get the picture 
Win only, on the Mac everything goes cleanly into the app package!

Best
Klaus
ah, yes, sorry, this will only work wih absolute filepathnames.3d-swiss wrote:A image with a path like "/Users/jens105/Desktop/unterordner/bild1.png" will shown in my stack, but a path like "./unterordner/bild1.png" not.
The second path will be generate by your script and so i will loose all images.
But you could do this before the repeat loop:
Code: Select all
...
put the filename of stack "your stack with relativ image pathname here" into tRoot
set itemdel to "/"
## Delete stack filename, so we get the missing piece in relative pathnames :-)
delete item -1 of tRoot
...
## Then in the repeat loop:
...
repeat with k = 1 to the num of images of cd i
put the filename of image k of cd i into tImageFile
## "there is a file...." will only work with absolute pathnames!
## Try to convert to ABSOLUTE path
if there is not a file tImageFile then
put tRoot into item 1 of tImageFile
end if
## Give up :-)
if there is not a file tImageFile then
next repeat
end if
put url("binfile:" & tImageFile) into image k of cd i
end repeat
...

No, this is just a placeholder for the actual foldername where the standalone will copied to by the enduser!3d-swiss wrote:P.S. When I can name a destination folder "referenced files" I expect that all ref. files will be in that folder (like InDesign collect all files in a folder called "link). Silly me?
Win only, on the Mac everything goes cleanly into the app package!

No idea, I do all my "serious" work on my Mac3d-swiss wrote:P.P.S. I know that fireworks is on Windows too, but the program is not free at all. Can't believe that there is no other program, hat can work with .png like Fireworks.

Best
Klaus
Re: How to make a referenced image part of the stack
Thanks for the answers.
I will try the code later on
Have a good weekend.
Jens
I will try the code later on

Have a good weekend.
Jens
-
- Posts: 1
- Joined: Thu Apr 19, 2012 12:41 pm
Re: How to make a referenced image part of the stack
Hello Jens,
You have actually asked two questions I believe:
1. How to reference images within a stack
2. What application to use to (edit) manipulate images? (I'm not sure what you're getting at here).
In answer to the first question, my thoughts were that you create a hidden card (sub-stack) that contains all of your images. This is seen in one of the 6 Beginner training videos.. I am not allowed to post the link, but it's on Video number 4. Start watching from 00:02:30. You will see that images are referred to as ID's hence they must be imported and they live in a sub-stack. This would work fine provided the images did not need to change.
As for question 2. Depending on your budget, I could recommend ACDSee as an easy image editor that requires little or no education - very easy to use... Photoshop costs money and requires some education. GIMP is free, but needs an understanding similar to that of photoshop. Ultimately, everyone ends up turning to photoshop... another commercial product is Corel Draw. From my own experience, ACDSee is a cheap and fast image editor that has a lot to offer.
The other quick and easy editor that comes to mind is from CoffeeCup called Web image Studio.
I hope this helps!
You have actually asked two questions I believe:
1. How to reference images within a stack
2. What application to use to (edit) manipulate images? (I'm not sure what you're getting at here).
In answer to the first question, my thoughts were that you create a hidden card (sub-stack) that contains all of your images. This is seen in one of the 6 Beginner training videos.. I am not allowed to post the link, but it's on Video number 4. Start watching from 00:02:30. You will see that images are referred to as ID's hence they must be imported and they live in a sub-stack. This would work fine provided the images did not need to change.
As for question 2. Depending on your budget, I could recommend ACDSee as an easy image editor that requires little or no education - very easy to use... Photoshop costs money and requires some education. GIMP is free, but needs an understanding similar to that of photoshop. Ultimately, everyone ends up turning to photoshop... another commercial product is Corel Draw. From my own experience, ACDSee is a cheap and fast image editor that has a lot to offer.
The other quick and easy editor that comes to mind is from CoffeeCup called Web image Studio.
I hope this helps!