Page 1 of 1
Reading in images with a standalone
Posted: Thu Aug 27, 2009 2:05 pm
by sketchpad92
I am creating a program with about 100 image files. The way I have it set up is to loop through a list of filenames, setting the image to the specified filename on each iteration. When transferring to a standalone, the images are not showing up, presumably because the program is not accessing the files. If you add the file in the standalone settings panel, the image shows up, but this method is not particularly user friendly as it only lets you add one file at a time...making entering 100 or so onto that list rather tedious (especially when I am dealing with about 4 experiments of 100 images at a time). Is there another way for the standalone to be able to read the image files in? Perhaps I could do something from within the code that would allow it to access the files?
Posted: Thu Aug 27, 2009 2:21 pm
by BvG
Like with your writing file question, this boils down to wrong filepaths. try to make a small test app with your filepath code put into a field instead of directly trying to access the file, and look where the problem could be. An example could be:
Code: Select all
on mouseUp
put the effective filename of this stack into thePath
set the itemdelimiter to slash
put item 1 to -2 of thePath & slash into thePath
--go url ("binfile:" & thePath & "data.rev")
put thePath into field 1
end mouseUp
If you do not know how a correct path should look like, use the following code in the message box to see a path:
common problems:
- forgetting brackets around urls. the url will only work if it's all in one piece so the following won't work:
Code: Select all
put url "file:" & myPath into theVar
--correct would be:
put url ("file:" & myPath) into myVar
- using && instead of &: This has bitten me quite a few times... strangely i do not learn from that experience
- missing slashes, or too many slashes. Again make sure your path is exact and correct.
- using existing paths that change when on another computer/directory/hard disk: If you hardcode the wrong parts of your path (for example always using "c:" then you might run into problems when the code is run from other locations.
Posted: Thu Aug 27, 2009 2:54 pm
by sketchpad92
So it seems....Thanks so much for your response. I've got it up and running now....It's been a long day
