|
Next: Beep-sound
|
| Author |
Message |
External

Since: Sep 30, 2008 Posts: 17
|
(Msg. 1) Posted: Tue Nov 25, 2008 2:07 am
Post subject: Mailbox selection Archived from groups: alt>comp>lang>applescript (more info?)
|
|
|
hi,
i wanted to know which folder is selected in mail.app. but i won;t
able to get this information. While in entourage i would be able to
get selected folder. can anybody tell me how would i get this
information.
For example: i have created 1 folder test on my mac container, now i
want to check wether this folder is selected or not.
[applescript]
tell application "Mail"
--make new mailbox with properties {name:"test"}
--tell mailboxes
set theselected to the selection
return theselected as string
--end tell
end tell
[/applescript]
regards,
anni |
|
| Back to top |
|
 |  |
External

Since: Nov 05, 2007 Posts: 1218
|
(Msg. 2) Posted: Tue Nov 25, 2008 10:57 am
Post subject: Re: Mailbox selection [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
In article
<62fc5a54-970a-43ba-b625-7abac803b808.DeleteThis@r24g2000prr.googlegroups.com>,
anni <coolanil.saini.DeleteThis@gmail.com> wrote:
> i wanted to know which folder is selected in mail.app. but i won;t
> able to get this information. While in entourage i would be able to
> get selected folder. can anybody tell me how would i get this
> information.
>
> For example: i have created 1 folder test on my mac container, now i
> want to check wether this folder is selected or not.
Do you know how to examine Applescript dictionaries? (Run Script Editor,
choose File > Open Dictionary, and select Mail in the list.)
If you take a look at the Mail dictionary, you'll see that Mail has a
"message viewer" class. The message viewer class has this property:
selected mailboxes (list of mailbox) : List of mailboxes currently
selected in the list of mailboxes
So you'll want to read the "selected mailboxes" property of the main
"message viewer". I tried this and it works. There are a few ways to
write it:
-- begin script
tell application "Mail"
--method #1:
tell the front message viewer
set selFolders to the selected mailboxes
end tell
-- method #2:
set selFolders to the selected mailboxes of the front message viewer
-- method #3:
set selFolders to the front message viewer's selected mailboxes
end tell
-- end script
Enjoy
--
Send responses to the relevant news group rather than email to me.
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.
JR |
|
| Back to top |
|
 |  |
External

Since: Aug 30, 2005 Posts: 1352
|
(Msg. 3) Posted: Tue Nov 25, 2008 2:43 pm
Post subject: Re: Mailbox selection [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
External

Since: Aug 30, 2005 Posts: 1352
|
(Msg. 4) Posted: Tue Nov 25, 2008 2:49 pm
Post subject: Re: Mailbox selection [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
External

Since: Nov 05, 2007 Posts: 1218
|
(Msg. 5) Posted: Tue Nov 25, 2008 4:01 pm
Post subject: Re: Mailbox selection [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
In article <michelle-4E5631.14493625112008 DeleteThis @mara100-84.onlink.net>,
Michelle Steiner <michelle DeleteThis @michelle.org> wrote:
> In article <jollyroger-FEFFA2.10573625112008 DeleteThis @news.individual.net>,
> Jolly Roger <jollyroger DeleteThis @pobox.com> wrote:
>
> > If you take a look at the Mail dictionary, you'll see that Mail has a
> > "message viewer" class. The message viewer class has this property:
> >
> > selected mailboxes (list of mailbox) : List of mailboxes currently
> > selected in the list of mailboxes
>
> Curiously though, the dictionary item for mailbox does not show that
> message viewer is a container for mailboxes, but it does show that the
> application is a container for message viewer.
>
> So if one checks "message" in the dictionary as I did, one would be led
> astray. Fortunately, I've been scripting mail.app long enough to
> realize that there is a message viewer object, and was able to figure
> things out.
>
> Apple should never have made "selected mailboxes" (or "selected
> messages" or "selected signature" a property. "Selected" should have
> been defined by itself, and the object specified separately.
Or to bring it more inline with other mail applications, they could have
simply made "selected whatever" a property of the application class.
--
Send responses to the relevant news group rather than email to me.
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.
JR |
|
| Back to top |
|
 |  |
External

Since: Aug 30, 2005 Posts: 1352
|
(Msg. 6) Posted: Tue Nov 25, 2008 4:01 pm
Post subject: Re: Mailbox selection [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
External

Since: Nov 05, 2007 Posts: 1218
|
(Msg. 7) Posted: Tue Nov 25, 2008 5:06 pm
Post subject: Re: Mailbox selection [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
In article <michelle-93B3DB.15593525112008.DeleteThis@mara100-84.onlink.net>,
Michelle Steiner <michelle.DeleteThis@michelle.org> wrote:
> In article <jollyroger-AB6CDF.16011125112008.DeleteThis@news.individual.net>,
> Jolly Roger <jollyroger.DeleteThis@pobox.com> wrote:
>
> > > Apple should never have made "selected mailboxes" (or "selected
> > > messages" or "selected signature" a property. "Selected" should
> > > have been defined by itself, and the object specified separately.
> >
> > Or to bring it more inline with other mail applications, they could
> > have simply made "selected whatever" a property of the application
> > class.
>
> As it is "selected messages" and "selected mailboxes" are properties of
> message viewer, and "selected signature" is a property of the
> application.
>
> I don't see why message viewer should exist in the first place; does
> anyone ever have more than one of them open at the same time?
To be honest, I don't see much utility in it either. I wasn't even aware
you *could* open more than one viewer to view your messages folders.
--
Send responses to the relevant news group rather than email to me.
E-mail sent to this address may be devoured by my very hungry SPAM
filter. Due to Google's refusal to prevent spammers from posting
messages through their servers, I often ignore posts from Google
Groups. Use a real news client if you want me to see your posts.
JR |
|
| Back to top |
|
 |  |
External

Since: Aug 30, 2005 Posts: 1352
|
(Msg. 8) Posted: Tue Nov 25, 2008 5:06 pm
Post subject: Re: Mailbox selection [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
External

Since: Sep 30, 2008 Posts: 17
|
(Msg. 9) Posted: Wed Nov 26, 2008 12:27 am
Post subject: Re: Mailbox selection [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
|
|
|
On Nov 26, 4:29 am, Michelle Steiner <miche....TakeThisOut@michelle.org> wrote:
> In article <jollyroger-E6DAE2.17064125112....TakeThisOut@news.individual.net>,
> Jolly Roger <jollyro....TakeThisOut@pobox.com> wrote:
>
> > > I don't see why message viewer should exist in the first place;
> > > does anyone ever have more than one of them open at the same time?
>
> > To be honest, I don't see much utility in it either. I wasn't even
> > aware you *could* open more than one viewer to view your messages
> > folders.
>
> Yeah, you can open as many as you wish. I don't know why, either.
>
> --
> It's now time for healing, and for fixing the damage the GOP did to America.
thanx for your valuable inputs...
event i didn't aware, we could open more than one viewer. can anybody
tell me how can we open more than 1 viewer.
or we can set some object to viewer such as i want to open safari in
message viewer, is it possible? |
|
| Back to top |
|
 |  |
External

Since: Aug 30, 2005 Posts: 1352
|
(Msg. 10) Posted: Wed Nov 26, 2008 7:04 am
Post subject: Re: Mailbox selection [Login to view extended thread Info.] Imported from groups: per prev. post (more info?)
|
|
|
This message is not archived |
|
| Back to top |
|
 |  |
| Related Topics: | import Mail mailbox at - Hi, no matter what kind of path I put into it I couldn't get Mail.app's "import Mail mailbox at" command to do *anything*, not even give errors!? -- Tobias Weber
scripting Quicktime to convert images to jpg - Here is a droplet that I am working on to have Quicktime translate still images generated by iMovie into JPG images that can be imported into iPhoto. on open (theList) tell application "Finder" repeat with x in theList if {"disk&quo...
Help with script, please - Here is the script: tell application "Mail" set foo to the selection set foo to item 1 of foo set address_ to address of item 1 of to recipient of foo if not (name of item 1 of to recipient of foo exists) then set AppleScript...
Finder label texts - Hi, it's easy to get a file's label *number*: set f to (choose file) tell application "Finder" get label index of f --as text end tell But how do I get the text? By somehow reading the Finder preferences? -- Tobias Weber
Open a file in PhotoshopCS - I would open an image with photoshop and do some action. I try this 2 scripts: set the topLevelFolder to (choose folder) as string tell application "Finder" set fileList to name of every file of folder topLevelFolder as list end tell ... |
|
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
|
|
|
|