Deleting interface items after a certain event

I have a drag n drop area for a user to drag a file. When they drag that files there, I want the drag n drop area in the interface window to go away so I can put a different interface item. for example, maybe i could put

delete image view “ImageView” of tab view item 3 of tab view “MainTab” of window “Window”

and then just have a message under there that would show once that item is deleted. I tried the above code and got an error “AppleEvent handler failed. (-10000)”

any help?

Hi,

what about hiding it or switching between tabs of a tab view etc… ?

if you really need to ‘delete’ a view you might use a method call (sry - I don’t know if there is an AppleScript equivalent):

call method "removeFromSuperview" of (image view "ImageView" of tab view item 3 of tab view "MainTab" of window "Window")

D.

Note: it might be necessary to update the window since for example a focus ring might remain visible

you could simply set to hide the image view after the person has done its stuff:


-- The actions before...

set visible of image view "ImageView" of tab view item 3 of tab view "MainTab" of window "Window" to false

-- The actions after...

If you want to get the image view back to be viewed, the set the “false” to “true”