Page 1 of 1

Image Source Issue: Grouped Controls and Image Source Reference was changed - problem for iOS App

Posted: Fri Nov 22, 2019 2:54 pm
by booee
So I notice some of my image sources show (SHORTENED SOURCE URL):
images/imageDOTpng

And others show (LONG SOURCE URL):
/Users/mycomputername/Documents/LiveCode App/myimageDOTpng

I figured out the bottom issue took place when I "group controls" together, I believe it changed the IMG SRC to the long version.
The issue is that if I create an iOS app, and put my application on an iPad...None of the images that have the LONG source show up on the App.
The bigger issue is that manually changing all of the images isn't really a possibility. It would be thousands of manual changes.

Any idea of how to deal with this?

Thanks!

Re: Image Source Issue: Grouped Controls and Image Source Reference was changed - problem for iOS App

Posted: Fri Nov 22, 2019 6:05 pm
by Klaus
Hi booee,

yes, this is a known problem when using absolute pathnames.
So your stack with the images is in this folder:
/Users/mycomputername/Documents/LiveCode App/
?
And ALL of your images are in that folder resp. in a subfolder named "images" inside of that folder?

Then you can use a little script to remove the ABSOLUTE part of the filenames.
Like this, out of my head, so better try this with a copy of your stack!
Create a button in your stack, you can later delete it, with this script:

Code: Select all

on mouseUp 
   
   ## We loop though all cards...
   put the num of cds of this stack into tNumberOfCards
   repeat with i = 1 to tNumberOfCards
      put the num of images of cd i into tNumberOfImages
      
      ## ...and through all images on each card
      repeat with k = 1 to tNumberOfImages
         put the filename of img k of cd i into tFileName
         
         ## Remove the absolute part from the filename, so the RELATIVE path remains
         replace "/Users/mycomputername/Documents/LiveCode App/" with EMPTY in tFileName
         ## If that "string" is NOT in the fielname, nothing will happen
         ## Means all images with NO abolute pathname will not be touched!
         
         ## Set filename again, but now with the relative pathname
         set the filename of img k of cd i to tFileName         
      end repeat
   end repeat
end mouseUp
Best

Klaus

Re: Image Source Issue: Grouped Controls and Image Source Reference was changed - problem for iOS App

Posted: Fri Nov 22, 2019 7:18 pm
by booee
Oh wow, this is amazing. Yup, all of my images are in that folder.

Thank you so much for your help!