help i have this problem
i need to load image in to image view via --display open panel attached to window of theObject-- :
this not work for me
on clicked theObject
if name of theObject is "downloads_button" then
set tmpPath to display open panel attached to window of theObject
set theImage to load image tmpPath
set image of image view "userImage" of window "main" to theImage
end clicked
This work
if name of theObject is "downloads_button" then
set tmpPath to chose file
set theImage to load image tmpPath
set image of image view "userImage" of window "main" to theImage
someone have idea load one image using to display open panel attached to window of theObject
Model: G5 DP 2700
AppleScript: 2.1
Browser: Safari 412.2.2
Operating System: Mac OS X (10.4)
Having the open panel attached to a window requires that you separate the functions of opening the open panel and dealing with the results of the open panel. When the user is done selecting the image file, the app then calls the function âon panel ended theObject with result withResultâ. It will be in the panel ended handler that you will load the image.
on panel ended theObject with result withResult
if withResult is 1 then
set image of image view "userImage" of window "main" to load image (path name of open panel)
end if
end panel ended
on clicked theObject
if name of theObject is "downloads_theme" then
display open panel attached to window of theObject
end if
end clicked
on panel ended theObject with result withResult
if withResult is 1 then
set image of image view "userImage" of window "main" to load image (path name of open panel)
end if
end panel ended
someone have idea for thisâŚ
Model: G5-2700
AppleScript: 2.1
Browser: Safari 412.2
Operating System: Mac OS X (10.4)
I tested the following code in a quick app I threw together and it worked. It may have been that âload image (path name of open panel)â line because that didnât work for me.
Also, have you connected window âmainâ to the panel ended handler in IB?
on clicked theObject
if name of theObject is "choose" then
set can choose files of open panel to true
set can choose directories of open panel to false
display open panel attached to window of theObject
end if
end clicked
on panel ended theObject with result withResult
if withResult is 1 then
set imagePath to path name of open panel
set image of image view "imageView" of window "main" to load image imagePath
end if
end panel ended