|
Image DownloaderI'm want to have a patch download an Image called Image_A from the same folder as the .qtz file is in. I want to specify a relative file path. If the Quartz file changes location I wish the image download patch to locate Image_A in the location of Quartz file's new folder. Hope that makes sense. Thought it would be easy as /Image_A but I'm stumped. Image_A could alternatively be in a sub-folder as in Folder_Containing_the_Quartz_File/Images/Image_A if that's how I need to do it.
|
In interest of completeness I'm going to commit low-rent act of replying to my own post.
Just came up on quartz-dev list (seems to be a issue inside iterators) and links led me to answer:
Directory scanner patch with name of images nested-folder (ie folder inside same folder as the quartz patch) in path. Feed structure to Create Image Structure patch then index patches etc. etc.
For discussion:
http://memo.tv/quartz_composer_3d_carousel_and_loading_images_within_an_...
Solution:
http://himiko.dnsalias.net/twiki/bin/view/Main/QuartzComposer#Reading_Im...
That's still a Leopard composition (using leopard javascript, and possibly some other 10.5 extensions), so it won't be helpful on Tiger.
Oh okay, my need was to find a relative path for image downloading so the image downloader would follow the .qtz patch wherever it goes, if that makes sense.
I guess I hijacked the other issue to get the answer I needed. Sorry about the confusion.
oops, I think I replied to the wrong thread -- there was another question recently about doing the same thing, but in tiger. sorry about that!
As usual cwright is 100% precient. I re-examined my patch to discover the (Leopard only) JS patch which is unnecessary. So here is my very much simplified version for any novice (like me) who has followed these bread crumbs in the future...
Hey, thanks for posting your final quartz file.
I know you have had your questions answered but I thought I'll reply anyway to a couple of things you said.
Yep, this is exactly what a relative link does.
I know you have it working but you have to be careful with your slashes on a mac.
In short
/Image_A is an absolute path and is not the same as ./Image_A which is a relative path and with regards to the Directory Scanner patch is the same as Image_a
In Long
With unix (therefore mac) the slash / means your root directory. So /images would be a file on your root directly, this is a absolute link not a relative link.
Also in unix this guy --> . <--- as in the full stop, is used to refer to the current directory. So an images file in the current directory would be ./images which is vastly different to /images
And for completeness these two .. as in two full stops mean go up a level so ../images would be a file called images in the parent directory.
Also the / at the end of the name means it is a directory (folder), so ../images/ is a directory called images in the parent directory. Generally you don't have to put the / on the end of directory names as most programs are smart enough to recongise it is a folder.
Well, Hope this all helps a little bit
That actually helps ALOT.
Instant gratification would have had you post at time of OP but it turned out instructional for me to have to work out a rough hack. I'd forgotten about the Directory scanner patch.
As my quartz starts becoming more interactive I'll be needing more of those kinds of patches and more of the Unix 101 help you kindly offered. Thanks again, when I don't know the basics like that it can be soooo frustrating as one little bit of "known unknowns" is holding me back.
Live to give :)
Yeah i'm all for self learning, but for some things its just much better to be told in one minute then spending hours on the net trying to find it.