Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Heli0s38

macrumors newbie
Original poster
May 4, 2009
8
0
Hello,

i'm having some issues with xcode 3 and AppleScript.


i'm making a Doc-based Applescript app (a simple web browser for a friend's mac thats pretty old.)

i added a menu called "Tools" and it was labeled in applescript "mnuTools" and a menu item "Download Manager" labeled in applescript "mnuDownload"

i havent entered in the code for what it should do when clicked, i just wanted to make sure it worked first, but when i run it i get an error.

"The specified object is a property, not an element. (-10008)"

ive tried numerous methods of fixing this. am i missing something? here is the code.

Code:
on choose menu item theObject
	if theObject is menu item "mnuDownload" of menu "mnuTools" then
		display dialog "its working"
	end if  
end choose menu item


and everything seems to check out in IB.
 
This worked for me: in IB with the "Download Manager" menu item selected, go to Tools > AppleScript Inspector and give it a name "mnuDownload". Then change your code to:
Code:
on choose menu item theObject
    if name of theObject is "mnuDownload" then
        display dialog "its working"
    end if
end choose menu item
 
sorry for bumping such an old thread, but i completely forgot to reply saying that worked. thank you so much and im terribly sorry for bumping
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.