Set Image Reference to Relative Path
Sannyasin Brahmanathaswami
brahma at hindu.org
Sun Apr 3 23:40:46 EDT 2016
I just made the happy discovery... no doubt known to many that you can declare a relative path for image reference. Assuming your have this directory layout
myApp.livecode
/img
fish.jpg
if you use the inspector to pick this image you get:
/Users/Brahmanathaswami/Documents/App Development/myApp/App Source/img/fish.jpg
# and it appears, of course.
but if you put this on a mobile device it breaks, of course...
but if you chop the path manually to
img/fish.jpg
it works.
Am I the only one that thinks a great enhancement would be to insert a relative path?
OR do we have a but where that should be the default behavior. Why?
Because the current preferences ship with
"Always us absolute file paths for images" unchecked.
but that is what we are getting anyway.
OK so it's trivial to write a script to crawl all images in your stack to chop of leading path segments and henceforth, manually clear those everytime you set an image page from the inspector.
But maybe it should work as expected? if that preference (always use absolut paths for images) is unchecked, then the path should be inserted are relative to main stack.
BR
More information about the use-livecode
mailing list