• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How can I display a dialog in one non-main thread?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How can I display a dialog in one non-main thread?


  • Subject: How can I display a dialog in one non-main thread?
  • From: "Dan" <email@hidden>
  • Date: Sat, 20 Sep 2003 10:56:19 +0800

Dear All:
I have some problem about AppleScript , cocoa Multithread.

In Main Thread, I create a new thread:

...
[NSThread detachNewThreadSelector:@selector(thread1:) toTarget:self withObject]
...

In thread1, I only display a dialog:

- (void) thread1
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSString *script = [[NSString alloc] initWithFormat:
@"display dialog \"Hello Thread1\"];
NSAppleScript *appleScript = [[NSAppleScript alloc] initWithSource:script];

NSMutableDictionary *errors = [NSMutableDictionary dictionary];

[appleScript executeAndReturnError:&errors];
[appleScript release];
[script release];


[pool release];
}


But there only show a blank dialog, there is no any text and button on dialog.
How can I do that? Who can help me?

Thanks a lot!

Best Regards
Dan
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How can I display a dialog in one non-main thread?
      • From: Paul Berkowitz <email@hidden>
    • Mail script to fight latest Blaster garbage
      • From: Jim Burton <email@hidden>
  • Prev by Date: Re: choose application list - revisited
  • Next by Date: Mail script to fight latest Blaster garbage
  • Previous by thread: Re: NSReceiverEvalutationScriptError: 4
  • Next by thread: Mail script to fight latest Blaster garbage
  • Index(es):
    • Date
    • Thread