Page 1 of 1

Trouble importing image

Posted: Sun Apr 26, 2015 5:35 am
by david_fff
I created an import button on card 1 of a window with the script:
on mouseup
answer file "Select jpeg file"
put there is a file it into Isfilethere
put Isfilethere
import paint from file it
end mouseup
Isfilethere comes back as true, but no image file is imported. I have tried this on images with .png and .jpg extensions and no go.
Any help would be appreciated! Thanks!

Re: Trouble importing image

Posted: Sun Apr 26, 2015 9:27 am
by jmburnod
Hi David,

I tried your script with LC 6.7.0 and it works for me
Which version of liveCode you use ?
Best regards
Jean-Marc

Re: Trouble importing image

Posted: Sun Apr 26, 2015 5:58 pm
by david_fff
Livecode 7.00 with OS X Yosemite 10.3.3.

Re: Trouble importing image

Posted: Sun Apr 26, 2015 6:03 pm
by FourthWorld
It's almost always helpful to check "the result" after any command that may have errors. Those involving disk I/O can often benefit from checking sysError() as well, as that will return any OS error code if something went wrong.

So in your case, right after your import command add this:

Code: Select all

if the result is not empty then
  answer "An error occured: "& the result &"("& sysError() &")"
end if

Re: Trouble importing image

Posted: Mon Apr 27, 2015 12:18 am
by david_fff
Well, the result was empty. Nothing came up with your script, Richard. But I did learn that
it's the operating system: the import worked just fine on a MacBook Pro running 10.8.5. It
just does not work on 10.10.3 ("Yosemite"). Hopefully the next Livecode update will fix it.
Thanks,
Dave

Re: Trouble importing image

Posted: Mon Apr 27, 2015 12:32 am
by david_fff
Ok, Murphy was just having his way with me. Believe it or not, I went back to the stack on Yosemite
(and this is the same file, mind, because it's syncing via Dropbox) and now it's importing. I did not
touch the script, it is the exact script that did not work before and now, since I guess it got "permission"
when it worked on OSX 10.8.5, decided to join the land of the living scripts. Go figure...