I’ve managed to get an icon in the menubar using some simple Cocoa. It does almost all that I want, except I can’t seem to get the menu to work…
EDIT: updated the script taking into account the comments and corrections from this thread!!!
Here are the steps needed:
Add in your Xcode project a new file Cocoa, Objective-C Class and name it for this purpose “Menulet”. This should create two files: Menulet.h and Menulet.m
Yes, i see your problem
Do you know of a way that a script could change part of the menubar coding? like for example something showing the status and in the script it has a function that calls it and changes it?
Having Never use Xcode, and having no clue what so ever of what I am doing.
I wanted to see what this does.
I made an applescript project. Made the new file.Changed the .h and .m file, But where do I put this icon, and how do I tell the app where to look for it.?
When in Xcode double click “MainMenu.nib (English)”, this should open the program Interface Builder with your interface (which is not really used for the above purpose). In the newly opened window “MainMenu.nib (English)” you should see several tabs on top (Instances, Classes, Images, etc.). Click on the ‘Images’ tab. If you see your image file you should be ok, if not drag it into this window. I used a TIFF file, I don’t know whether it works with other file formats.
I did not get this working,
So I tried this Menulet introduction.
Which I think is the same type of thing this thread is about, (noob talking)
Please let me know if I should start this as a new thread.
I got most of it working, but I am stuck with the drop down menu from the icon.
I can not tell if my Ipmenulet is connected to the NSMenu1 which I suspect is the problem.
It say’s
I build and Go - no errors.
But the menu does not drop down from the icon??
Also I changed the Ip url to “http://www.whatismyip.org” as the one provided did not work that well.
I could not build withou errors with (dealloc:) in, so I took it out.
As you can see the icon menu is outside the function (that may sound like I know what I am talking about, don’t be fooled. :), when I put it inside I got the correct info in the inspector.
It is annoying that it compiles with no errors when there are, but I guess thats the nature of the beast.
I also notice that the intro url doe not really help in the structure of how the script should be laid out.
Hi Stadsman,
Do you know any good links to show me how I attach an applescript script to the menu.
Also my applescript opens up in Script Editor? I can not find a pref to keep it in xcode??