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

tom3097

macrumors newbie
Original poster
Oct 12, 2005
16
0
Is there a way for when an application launches it checks to see if certain applications are open.

If so change the properties of certain items on a window.

Objective C or Applescript, which ever can do it. Please note that i know only limited Applescript and hardly and Objective C.
 

tom3097

macrumors newbie
Original poster
Oct 12, 2005
16
0
robbieduncan said:
You could shell out to ps to get a list of running processes and check that?

Note sure how to do that, and does objective-c allow editing of an applications window. i.e. change some text.
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,629
Western US
tom3097 said:
Note sure how to do that, and does objective-c allow editing of an applications window. i.e. change some text.
Change what text? Are you talking about in your application or in some other running application? In the first case, certainly, if you're trying to change text in some other running application, no, or not easily anyway. At least not without that application's cooperation, or through AppleScript or something. Applications are generally not supposed to go poking around in other applications changing things without their knowledge. As for getting a process list you can look up "man ps" in the Terminal and the see Apple documentation for NSPipe and TSTask.
 

tom3097

macrumors newbie
Original poster
Oct 12, 2005
16
0
HiRez said:
Change what text? Are you talking about in your application or in some other running application? In the first case, certainly, if you're trying to change text in some other running application, no, or not easily anyway. At least not without that application's cooperation, or through AppleScript or something. Applications are generally not supposed to go poking around in other applications changing things without their knowledge. As for getting a process list you can look up "man ps" in the Terminal and the see Apple documentation for NSPipe and TSTask.

Thanks, and its changing text in my application not some other application.
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,629
Western US
tom3097 said:
Thanks, and its changing text in my application not some other application.
Some Cocoa UI controls, such as NSTextField, have a method -setStringValue: where you can pass them an NSString to change their value (the text). This can also be accomplished through Cocoa bindings. If you mean the window's title, either set it directly in IB or send the window a -setTitle: message with an NSString.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.