Hi all!
I have been banging my head against my keyboard for the last half hour trying to figure out the correct syntax for this command. I am trying to make an image appear in an image view box that is inside a tab. Here’s my current rendition of the code:
set image of image view "orgImage" of view of tab view "sortAndName" of window "main" to load image (thisImage as alias)
but I get this back for an error:
So what am I doing wrong?
Thanks much!
I think you’re missing a tab view item
:
set image of image view "orgImage" of tab view item "whatever" of tab view "sortAndName" of window "main" to load image (thisImage as alias)
I tried adding in the code, but it kept giving me the same response. I’m wondering if I have something else wrong with my function. Although I’m having a terrible time trying to access anything inside my tab views.
Here is what I have for my entire function.
on loadPhoto(thisImage) --thisImage is a string path to a file
set image of image view "orgImage" to load image (thisImage as alias)
--set image of image view "orgImage" of tab view item "toolKit" of tab view "sortAndName" of window "main" to load image (thisImage as alias)
--set image of image view "orgImage" of view of tab view "sortAndName" of window "main" to load image (thisImage as alias)
end loadPhoto
I tried to change up the method of referral to see if that changed things, such as
tell tab view 1 of window 1
--set current tab view item to tab view item "sortAndName"
set image of image view "orgImage" to load image (thisImage as alias)
end tell
But that doesn’t seem to help.
I’m going to keep playing with it though. I’m starting to understand it better as I find out what doesn’t work. Any help is greatly appreciated though.
Okay, I think I’m making some progress. I added the POSIX terminology and got this error instead.
It’s time for bed here now, but I’ll play around with it some tomorrow as well.
Thank you much for the help thus far!
Okay. I’ve been testing out a few different methods and finally got the image to appear in the box, but now I’m getting an error that reads:
The code for my function is as such:
on loadPhoto(thisImage)
if curTab is "sortAndName" then
set image of image view "orgImage" of tab view item "sortAndName" of tab view "toolKit" of window "main" to load image (thisImage as alias)
else if curTab is "reviewAndDelete" then
end if
end loadPhoto
thisImage is passed into the fuction as:
set theImage to orgSourceFolder & (item 2 of sourceList) as string
loadPhoto(theImage)
I run the script, (choose a folder of images) and the image pops up along the the error message quoted above. Any ideas?