|
Next: Entourage Auto Quits
|
| Author |
Message |
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 |
|
 |  |
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 |
|
 |  |
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
Armel |
|
| Back to top |
|
 |  |
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 |
|
 |  |
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?)
|
|
|
|
|
| Back to top |
|
 |  |
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 |
|
 |  |
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 |
|
 |  |
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?)
|
|
|
|
|
| Back to top |
|
 |  |
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 |
|
 |  |