get the currently active finder window using objc

Joined
Aug 7, 2009
Messages
2
Reaction score
0
Points
1
Hi everyone,
I have many small projects I once created with AppleScript Studio.
Now that AppleScript Studio was cancelled I decided to learn ObjC and for training purposes I do all of my AppleScript Studio projects in ObjC. Nice training;)

Right now i'm working on my FileNamerX. I's a small application for lion to change file and folder names on the fly as well as adding and removing suffixes and prefixes. In order to get this working I check on awakeFromNib if there is an open Finder window.

At the the moment I wonder if it is possible to do this using objective-c. All of the solutions I googled use an AppleScript solution.

Is somebody out there who can shed some light on my brains?

Greetings from Switzerland
Ronald
---
 
Joined
Aug 13, 2011
Messages
200
Reaction score
7
Points
18
Location
West Sussex
I'm not aware of a direct way to access other desktop applications with Objective-C, but thats not to say there is'nt a way, I think I would look into the NSTask or NSApplescript class's.

https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSTask_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003745

https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSAppleScript_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40003618

The best way to interact with other desktop applications is definitely Applescript, a lot of the former Applescript studio users went over to the ApplescriptObjC language, using the Xcode developer tools, there is a very knowledgable bunch of people over at the Macscripter ApplescriptObjC forums, that I think could advise you with this one.

MacScripter

Good Luck.

Regards Mark
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top