I have having trouble writing the code that checks whether an image file exists in a folder. Using Windows 10 and LC 8.1.1. Let's say the image is "cat.png" and the image object on my card is image "animal." The following code for checking the existence of a folder works great:
Code: Select all
put "cat" into tImage
put "c:/Users/myName/Documents/Images/" into tFolder
if there is a folder tFolder then
set the filename of img "animal" to tFolder&tImage&".png"
end if
Code: Select all
put "cat" into tImage
put "c:/Users/myName/Documents/Images/" into tFolder
if there is a file tFolder&tImage&".png" then
set the filename of img "animal" to tFolder&tImage&".png"
end if
Monty