Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Opening a document and getting the window to front?

 
   Soft32 Home -> Mac -> Programmer Help RSS
Next:  Entourage Auto Quits  
Author Message
Armel

External


Since: May 27, 2009
Posts: 5



(Msg. 1) Posted: Wed May 27, 2009 5:20 pm
Post subject: Opening a document and getting the window to front?
Archived from groups: comp>sys>mac>programmer>help (more info?)

Hello,

I'm trying to open a folder in the Finder. I use AESend( ) with an event of
type kAEOpenDocument.
It opens correctly the folder... but the window appears behind my own
application. I tried to pass AEAlwaysInteract|kAECanSwitchLayer in the
AESendMode parameter but it does not seem to do anything.

any idea what i should do?

Regards
Armel
Back to top
Login to vote
matt neuburg

External


Since: Jun 12, 2005
Posts: 3141



(Msg. 2) Posted: Wed May 27, 2009 5:20 pm
Post subject: Re: Opening a document and getting the window to front? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Armel" <armelasselin (@) hotmail.com> wrote:

> Hello,
>
> I'm trying to open a folder in the Finder. I use AESend( ) with an event of
> type kAEOpenDocument.
> It opens correctly the folder... but the window appears behind my own
> application. I tried to pass AEAlwaysInteract|kAECanSwitchLayer in the
> AESendMode parameter but it does not seem to do anything.
>
> any idea what i should do?

You could tell the Finder to activate...?

If *all* you want to do is open a folder and bring it to the front,
though, sending an Apple event seems like a royal waste of brain power.
m.

--
matt neuburg, phd = matt.TakeThisOut@tidbits.com, http://www.tidbits.com/matt/
Leopard - http://www.takecontrolbooks.com/leopard-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com
Back to top
Login to vote
Armel

External


Since: May 27, 2009
Posts: 5



(Msg. 3) Posted: Wed May 27, 2009 5:20 pm
Post subject: Re: Opening a document and getting the window to front? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"matt neuburg" <matt DeleteThis @tidbits.com> a écrit dans le message de news:
1j0dnn1.1aikbjvschxjaN%matt@tidbits.com...
> "Armel" <armelasselin (@) hotmail.com> wrote:
>
>> Hello,
>>
>> I'm trying to open a folder in the Finder. I use AESend( ) with an event
>> of
>> type kAEOpenDocument.
>> It opens correctly the folder... but the window appears behind my own
>> application. I tried to pass AEAlwaysInteract|kAECanSwitchLayer in the
>> AESendMode parameter but it does not seem to do anything.
>>
>> any idea what i should do?
>
> You could tell the Finder to activate...?
>
> If *all* you want to do is open a folder and bring it to the front,
> though, sending an Apple event seems like a royal waste of brain power.
> m.
if you can give me something simpler, i'd be perfectly happy!
a snippet would of great help Smile

Armel
Back to top
Login to vote
Armel

External


Since: May 27, 2009
Posts: 5



(Msg. 4) Posted: Wed May 27, 2009 5:20 pm
Post subject: Re: Opening a document and getting the window to front? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"matt neuburg" <matt.RemoveThis@tidbits.com> a écrit dans le message de news:
1j0dnn1.1aikbjvschxjaN%matt@tidbits.com...
> "Armel" <armelasselin (@) hotmail.com> wrote:
>
>> Hello,
>>
>> I'm trying to open a folder in the Finder. I use AESend( ) with an event
>> of
>> type kAEOpenDocument.
>> It opens correctly the folder... but the window appears behind my own
>> application. I tried to pass AEAlwaysInteract|kAECanSwitchLayer in the
>> AESendMode parameter but it does not seem to do anything.
>>
>> any idea what i should do?
>
> You could tell the Finder to activate...?
>
> If *all* you want to do is open a folder and bring it to the front,
> though, sending an Apple event seems like a royal waste of brain power.
OK found LSOpenFSRef which seems to do what I wanted

Armel
Back to top
Login to vote
matt neuburg

External


Since: Jun 12, 2005
Posts: 3141



(Msg. 5) Posted: Wed May 27, 2009 5:20 pm
Post subject: Re: Opening a document and getting the window to front? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Armel" <armelasselin (@) hotmail.com> wrote:

> OK found LSOpenFSRef which seems to do what I wanted

But what programming world are you operating in, where you have an
FSRef? I mean, it's like I'm talking to you down some kind of
20-year-old time machine. Here in the modern world I'd expect you to
have a pathname or file URL. NSWorkspace will just open that for you. m.

--
matt neuburg, phd = matt.DeleteThis@tidbits.com, http://www.tidbits.com/matt/
Leopard - http://www.takecontrolbooks.com/leopard-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com
Back to top
Login to vote
Gregory Weston

External


Since: Mar 26, 2005
Posts: 3646



(Msg. 6) Posted: Wed May 27, 2009 8:13 pm
Post subject: Re: Opening a document and getting the window to front? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <1j0duny.2y6pq4e14nosN%matt@tidbits.com>,
matt RemoveThis @tidbits.com (matt neuburg) wrote:

> "Armel" <armelasselin (@) hotmail.com> wrote:
>
> > OK found LSOpenFSRef which seems to do what I wanted
>
> But what programming world are you operating in, where you have an
> FSRef? I mean, it's like I'm talking to you down some kind of
> 20-year-old time machine. Here in the modern world I'd expect you to
> have a pathname or file URL. NSWorkspace will just open that for you. m.

Seems a bit of hyperbole, doesn't it? Leaving aside the fact that FSRefs
aren't 20 years old, there remain a fair number of situations where
Carbon is the better (or even only) way to get something done. The OP
never actually indicated he was writing an app, for example.

--
I saw a truck today that had "AAA Batteries / Delivered and Installed" on the
side. My first thought was: That's a really weird business model. How many
inept people have urgent need of skinny little battery cells?
Back to top
Login to vote
Armel

External


Since: May 27, 2009
Posts: 5



(Msg. 7) Posted: Thu May 28, 2009 3:20 am
Post subject: Re: Opening a document and getting the window to front? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"matt neuburg" <matt DeleteThis @tidbits.com> a écrit dans le message de news:
1j0duny.2y6pq4e14nosN%matt@tidbits.com...
> "Armel" <armelasselin (@) hotmail.com> wrote:
>
>> OK found LSOpenFSRef which seems to do what I wanted
>
> But what programming world are you operating in, where you have an
> FSRef? I mean, it's like I'm talking to you down some kind of
> 20-year-old time machine. Here in the modern world I'd expect you to
> have a pathname or file URL. NSWorkspace will just open that for you. m.
it seems Cocoa stuff isn't it? I have to stick to C++.. and i'm a total
newbie so calling a C API seems really much more simple to me than going
into Objective C stuff.
and yes I have URLs in input, but i'm sure in that case that they point into
the file system.

Regards
Armel
Back to top
Login to vote
matt neuburg

External


Since: Jun 12, 2005
Posts: 3141



(Msg. 8) Posted: Thu May 28, 2009 7:13 am
Post subject: Re: Opening a document and getting the window to front? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"Armel" <armelasselin (@) hotmail.com> wrote:

> and yes I have URLs in input

The I think you can call LSOpenCFURLRef, no? m.

--
matt neuburg, phd = matt.RemoveThis@tidbits.com, http://www.tidbits.com/matt/
Leopard - http://www.takecontrolbooks.com/leopard-customizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com
Back to top
Login to vote
Armel

External


Since: May 27, 2009
Posts: 5



(Msg. 9) Posted: Thu May 28, 2009 11:20 am
Post subject: Re: Opening a document and getting the window to front? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"matt neuburg" <matt DeleteThis @tidbits.com> a écrit dans le message de news:
1j0ezng.1ift3e61as415kN%matt@tidbits.com...
> "Armel" <armelasselin (@) hotmail.com> wrote:
>
>> and yes I have URLs in input
>
> Then I think you can call LSOpenCFURLRef, no? m.
yes indeed

Armel
Back to top
Login to vote
Display posts from previous:   
Related Topics:
[Q] Document app but with non-document opening window - ho.. - {Also posted on Cocoa-Dev} I'm starting a new project that is to be a Cocoa Multi-window Document app. When the..

Get front window in cocoa - Hi, Anyone knows how to get the front window in Cocoa ? I manange to get the the keyWindow and the mainWindow but not...

Opening an html document (macosx) - Hello people, Is there anyone who can tell me how to open a html document from my application? I'm writing an..

Resize/reposition a document window. - Hi all I am working on a document based cocoa (objective-c) application. I have a panel below the menu bar. When i ope...

Opening another window from a Tool? HELP. - I have a program that uses std I/O so I compile it as a Tool in Xcode. I get it to run and the program also opens a..

multiple document and window types in cocoa - Hello, Could I get some advice or recommendations on how best to organize the nib files and classes for a program I'm....
       Soft32 Home -> Mac -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows
 Linux
  Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]