getting the fileName of an image control

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

getting the fileName of an image control

Post by quailcreek » Thu Dec 31, 2015 12:32 am

Hi,
I need to do a little reverse engineering. This is for an iOs app.

In my preOpenCard I set the filename of the image control.

Code: Select all

 set the filename of image "imageHolder" to tPicPath
What I need to do is get the path to the file after its been set. I tried get the text of image "imageHolder" and get the fileName of image "imageHolder" but no-joy. Is there a way to do this?

It works in the IDE and from the message box.

Regards,
Tom
Tom
MacBook Pro OS Mojave 10.14

Martin Koob
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 256
Joined: Sun May 27, 2007 8:19 pm

Re: getting the fileName of an image control

Post by Martin Koob » Thu Dec 31, 2015 3:48 pm

Hi

'the filename of image' is the correct property name to use.

If you use 'get' then the filename will be in the 'it' variable so you have to put 'it' into your variable.

Code: Select all

   get the filename of image "imageHolder"
   put it into tPicPath
Or you can put the filename directly into the variable using 'put'.

Code: Select all

put the filename of image "imageHolder" into tPicPath
I tried this in both the IDE and a standalone and they work. (using LC 6.7.3)

Martin Koob

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: getting the fileName of an image control

Post by quailcreek » Thu Dec 31, 2015 7:31 pm

Thanks, Martin.

It might be an iOS 9.1 problem. I checked and this is broken in LC 7.1.1, 6.7.8 and LC 8 dp 8 thru 12. I checked in the sim and a device. I looked on the Quality Control Center and there was a similar bug but it only involved the IDE and desktop. I'll report this as a bug.
Tom
MacBook Pro OS Mojave 10.14

Post Reply