Cocoa Doc App and AppleScript Studio Support
Cocoa Doc App and AppleScript Studio Support
- Subject: Cocoa Doc App and AppleScript Studio Support
- From: Sean Todd <email@hidden>
- Date: Tue, 24 Feb 2004 16:16:34 -0600
This should be simple but...
In my Cocoa Doc-based app, I added a new menu item that would use a
simple script to open a URL in the user's default browser but have had
no success. To simplify things, I even tried this from a new Cocoa Doc
App project.
I followed the instructions described in "Add AppleScript Studio
Support to Your Cocoa Application":
in Xcode:
- create new Cocoa Doc-based Application project
- added the AppleScriptKit framework to the project
- added an AppleScript Build Phase to the target
- moved my script file (myscripts.applescript) into the new build phase
- added NSAppleScriptEnabled with a value of "YES" to Info.plist
in IB:
- added a new menu item under the Help menu in MainMenu.nib
- in the AppleScript Info View for this new menu item I selected my
script file
- selected the "choose menu item" Event Handler
- edited the script:
on choose menu item theObject
log theObject
open location "
http://www.apple.com"
end choose menu item
Result:
- when I select this menu item nothing happens. No logging and no
opened web page.
Control:
If I create an AppleScript Doc-based Application project and repeat the
same IB process then the menu item works as expected.
Is there something that I am missing in the Cocoa app?
Thanks for your help,
Sean
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.