Hello.
I'd like some help to build a Preference Pane (to put in the System
Preferences).
Can someone help me please?
The preference pane I need is very simple:
It's made up of a customizable title (My Preference Pane in my
example), a customizable static text (My free text in my example), and
a customizable button (My Button in my example).
When I press "My button" the preference pane must launch an AppleScript
that I place in the preference pane's bundle.
http://img135.imageshack.us/img135/9677/preferencepane5me.jpg
That's all.
It's probably just a matter of a few minutes of development for someone
who knows XCode.
Can someone help me please?
Thanks,
Pascal.
Gregory Weston - 05 Oct 2005 01:37 GMT
> Hello.
>
> I'd like some help to build a Preference Pane (to put in the System
> Preferences).
> Can someone help me please?
I've done a few, but if there's going to be actual back-and-forth
conversation I'd rather do it off Usenet. The address on this post works
if you'd like the help.
> The preference pane I need is very simple:
> It's made up of a customizable title (My Preference Pane in my
> example), a customizable static text (My free text in my example), and
> a customizable button (My Button in my example).
Piece of cake.
> When I press "My button" the preference pane must launch an AppleScript
> that I place in the preference pane's bundle.
Trivial. But I have to say this doesn't look like a typical use of a
preference pane. What's the rationale for not making this an
application? Or, for that matter, just a double-clickable AppleScript?
G

Signature
Goal 2005: Convincing James Hetfield to cover the Strawberry Shortcake
"Are You Berry Berry Happy?" song.
Michael Ash - 05 Oct 2005 10:35 GMT
> Hello.
>
[quoted text clipped - 16 lines]
> who knows XCode.
> Can someone help me please?
Are you asking for advice, or are you looking for someone to write the
pref pane for you?
If it's advice, you'll need to be much more specific about exactly what
you're having trouble with.
If you're looking for someone to do it for you, be aware that it's likely
that it won't be free.

Signature
Michael Ash
Rogue Amoeba Software
vze35xda@verizon.net - 05 Oct 2005 21:18 GMT
Example code follows:
This code starts the Terminal app and runs Telnet in that window having
it connect to
the input ip address.
NOTE: The script is actually a big format string which I used to
produce the real script in the NSString with the actual IP address in
it.
This is not exactly what you want, you just have to pull the SCRIPT
string from a file which is inside your app.
- (void)startTelnet:(NSString *)ip
{
NSDictionary *errd;
NSAppleEventDescriptor *ed;
NSString *scriptcode;
NSAppleScript *script;
// This is the script to execute
// It will bring up the TERMINAL and start a telnet
// connected to our IP
NSString *scriptfmt = @"using terms from application \"Terminal\"\
\ntell application \"Terminal\"\
\nactivate\
\n--delay 4\
\n--close window 1\
\nset argVal to \"/usr/bin/telnet %@ \"\
\ndo script argVal\
\nend tell\
\nend using terms from\
\n";
// (1) Build the script with the input IP address
scriptcode = [NSString stringWithFormat:scriptfmt,ip];
// (2) Create the Apple script
script = [[NSAppleScript alloc] initWithSource:scriptcode];
// (3) Run it
ed = [script executeAndReturnError:&errd];
}