Paul
Mon Mar 14 14:00:01 CST 2005
> This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--B_3193646402_13382746
Content-type: text/plain;
charset="ISO-8859-1"
Content-transfer-encoding: 8bit
On 3/14/05 10:23 AM, in article 1gtfeva.gv1aw71f3dmy4N%jeremy@yahoo.com,
"Jeremy Fieldsend" <jeremy@yahoo.com> wrote:
> Paul Berkowitz <berkowit@spoof_silcom.com> wrote:
>
>> Finally - you do realize you could make a task, optionally with a reminder,
>> instead of a note. But you'd have to know in advance how many days in
>> advance to make the reminder and/or due date.
>
> Which is, of course, a much more sensible route altogether. I've tried -
> unsuccessfully - to adapt your applescript. I don;t need the optional
> reminder, just a task which reads "call <name>, <phone>.
Really? All you needed to do as change the word 'note' to 'task'. (I'm also
changing the variable to 'theTask' in all places just so it reads better,
but it would have worked anyway as 'theNote') I actually forgot to comment
out the 'open' part last time, so I'm doing it here. If you want it to open,
remove the "--" characters. This version makes a task with no due date and
no reminder.
P.S. I send scripts in HTML for a good reason: otherwise long lines break in
the email and would create errors when compiling. You'd have to know soe
AppleScript to know where to restore long lines by removing carriage
returns. On the other hand, I've discovered that people reading these
messages in the Google (or other) web browser have problems with scripts
containing non-ASCII (non-basic) characters like ? (is not equal), which
come out as commas, for example, at least in HTML, since the browser is
using Windows character format, and also break the script. So I'm trying to
rememver to always use the more verbose English alternatives like 'is not
equal to'. I may need to be reminded occasionally. Anyway, you're all better
off using Entourage or another newsreader, not Google: your messages and the
replies will appear within a min ute or so of being sent, not 12 hours or
so.
tell application "Microsoft Entourage"
try
set theSelection to selection
if class of theSelection is not list then error number -128
on error
beep
display dialog "You can only run this script on selected
contact(s)." buttons {"Cancel"} default button 1 with icon 0
return
end try
repeat with i from 1 to (count theSelection)
repeat 1 times
set theContact to item i of theSelection
if class of theContact is not contact then exit repeat -- 1
times
set theName to name of theContact
set thePhone to business phone number of theContact
if thePhone = "" then set thePhone to home phone number of
theContact
set theText to "Call " & theName & ", " & thePhone
set {theCategories, theProjects} to theContact's {category,
project list}
set theTask to make new task with properties {name:theName,
content:theText, category:theCategories, project list:theProjects}
link theTask to theContact
--open theTask
end repeat
end repeat
end tell
--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <
http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <
http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Microsoft Office you are using -
**2004**, X or 2001. It's often impossible to answer your questions
otherwise.
--B_3193646402_13382746
Content-type: text/html;
charset="ISO-8859-1"
Content-transfer-encoding: quoted-printable
<HTML>
<HEAD>
<TITLE>Re: Create task from Contact</TITLE>
</HEAD>
<BODY>
<FONT FACE=3D"Verdana, Helvetica, Arial"><SPAN STYLE=3D'font-size:12.0px'>On 3/=
14/05 10:23 AM, in article 1gtfeva.gv1aw71f3dmy4N%jeremy@yahoo.com, "Je=
remy Fieldsend" <jeremy@yahoo.com> wrote:<BR>
<BR>
<FONT COLOR=3D"#0000FF">> Paul Berkowitz <berkowit@spoof_silcom.com>=
wrote:<BR>
> <BR>
</FONT><FONT COLOR=3D"#008000">>> Finally - you do realize you could ma=
ke a task, optionally with a reminder,<BR>
>> instead of a note. But you'd have to know in advance how many days=
in<BR>
>> advance to make the reminder and/or due date.<BR>
</FONT><FONT COLOR=3D"#0000FF">> <BR>
> Which is, of course, a much more sensible route altogether. I've tried=
-<BR>
> unsuccessfully - to adapt your applescript. I don;t need the optional<=
BR>
> reminder, just a task which reads "call <name>, <phone&g=
t;.<BR>
</FONT><BR>
Really? All you needed to do as change the word '<FONT COLOR=3D"#0000FF">note=
</FONT>' to '<FONT COLOR=3D"#0000FF">task</FONT>'. (I'm also changing the vari=
able to 'theTask' in all places just so it reads better, but it would have w=
orked anyway as 'theNote') I actually forgot to comment out the 'open' part =
last time, so I'm doing it here. If you want it to open, remove the "--=
" characters. This version makes a task with no due date and no reminde=
r.<BR>
<BR>
P.S. I send scripts in HTML for a good reason: otherwise long lines break i=
n the email and would create errors when compiling. You'd have to know soe A=
ppleScript to know where to restore long lines by removing carriage returns.=
On the other hand, I've discovered that people reading these messages in th=
e Google (or other) web browser have problems with scripts containing non-AS=
CII (non-basic) characters like ≠ (is not equal), which come out as co=
mmas, for example, at least in HTML, since the browser is using Windows char=
acter format, and also break the script. So I'm trying to rememver to always=
use the more verbose English alternatives like 'is not equal to'. I may nee=
d to be reminded occasionally. Anyway, you're all better off using Entourage=
or another newsreader, not Google: your messages and the replies will appea=
r within a min ute or so of being sent, not 12 hours or so.<BR>
<BR>
<BR>
<FONT COLOR=3D"#0000FF"><B>tell</B></FONT> <FONT COLOR=3D"#0000FF">application<=
/FONT> "Microsoft Entourage"<BR>
<FONT COLOR=3D"#0000FF"><B>try<BR>
</B></FONT> <FONT COLOR=3D"#0000FF"=
><B>set</B></FONT> <FONT COLOR=3D"#408000">theSelection</FONT> <FONT COLOR=3D"#0=
000FF"><B>to</B></FONT> <FONT COLOR=3D"#0000FF">selection<BR>
</FONT> <FONT COLOR=3D"#0000FF"><B>=
if</B></FONT> <FONT COLOR=3D"#0000FF">class</FONT> <FONT COLOR=3D"#0000FF"><B>of=
</B></FONT> <FONT COLOR=3D"#408000">theSelection</FONT> <FONT COLOR=3D"#0000FF">=
<B>is</B></FONT> <FONT COLOR=3D"#0000FF"><B>not</B></FONT> <FONT COLOR=3D"#0000F=
F">list</FONT> <FONT COLOR=3D"#0000FF"><B>then</B></FONT> <FONT COLOR=3D"#0000FF=
"><B>error</B></FONT> <FONT COLOR=3D"#0000FF">number</FONT> -128<BR>
<FONT COLOR=3D"#0000FF"><B>on</B></FONT> <FONT COLOR=3D=
"#0000FF"><B>error<BR>
</B></FONT> <FONT COLOR=3D"#0000FF"=
>beep<BR>
</FONT> <FONT COLOR=3D"#0000FF">dis=
play dialog</FONT> "You can only run this script on selected contact(s)=
." <FONT COLOR=3D"#0000FF">buttons</FONT> {"Cancel"} <FONT COLO=
R=3D"#0000FF">default button</FONT> 1 <FONT COLOR=3D"#0000FF">with icon</FONT> 0=
<BR>
<FONT COLOR=3D"#0000FF"><B>re=
turn<BR>
</B></FONT> <FONT COLOR=3D"#0000FF"><B>end</B></FONT> <FONT=
COLOR=3D"#0000FF"><B>try<BR>
</B></FONT> <BR>
<FONT COLOR=3D"#0000FF"><B>repeat</B></FONT> <FONT CO=
LOR=3D"#0000FF"><B>with</B></FONT> <FONT COLOR=3D"#408000">i</FONT> <FONT COLOR=3D=
"#0000FF"><B>from</B></FONT> 1 <FONT COLOR=3D"#0000FF"><B>to</B></FONT> (<FONT=
COLOR=3D"#0000FF">count</FONT> <FONT COLOR=3D"#408000">theSelection</FONT>)<BR>
<FONT COLOR=3D"#0000FF"><B>re=
peat</B></FONT> 1 <FONT COLOR=3D"#0000FF"><B>times<BR>
</B></FONT> &nb=
sp;<FONT COLOR=3D"#0000FF"><B>set</B></FONT> <FONT COLOR=3D"#408000">theContact<=
/FONT> <FONT COLOR=3D"#0000FF"><B>to</B></FONT> <FONT COLOR=3D"#0000FF">item</FO=
NT> <FONT COLOR=3D"#408000">i</FONT> <FONT COLOR=3D"#0000FF"><B>of</B></FONT> <F=
ONT COLOR=3D"#408000">theSelection<BR>
</FONT> <=
FONT COLOR=3D"#0000FF"><B>if</B></FONT> <FONT COLOR=3D"#0000FF">class</FONT> <FO=
NT COLOR=3D"#0000FF"><B>of</B></FONT> <FONT COLOR=3D"#408000">theContact</FONT> =
<FONT COLOR=3D"#0000FF"><B>is</B></FONT> <FONT COLOR=3D"#0000FF"><B>not</B></FON=
T> <FONT COLOR=3D"#0000FF">contact</FONT> <FONT COLOR=3D"#0000FF"><B>then</B></F=
ONT> <FONT COLOR=3D"#0000FF"><B>exit</B></FONT> <FONT COLOR=3D"#0000FF"><B>repea=
t</B></FONT> --<FONT COLOR=3D"#4C4E4E"><I> 1 times<BR>
</I></FONT> &nb=
sp;<FONT COLOR=3D"#0000FF"><B>set</B></FONT> <FONT COLOR=3D"#408000">theName</FO=
NT> <FONT COLOR=3D"#0000FF"><B>to</B></FONT> <FONT COLOR=3D"#0000FF">name</FONT>=
<FONT COLOR=3D"#0000FF"><B>of</B></FONT> <FONT COLOR=3D"#408000">theContact<BR>
</FONT> <=
FONT COLOR=3D"#0000FF"><B>set</B></FONT> <FONT COLOR=3D"#408000">thePhone</FONT>=
<FONT COLOR=3D"#0000FF"><B>to</B></FONT> <FONT COLOR=3D"#0000FF">business phone=
number</FONT> <FONT COLOR=3D"#0000FF"><B>of</B></FONT> <FONT COLOR=3D"#408000">=
theContact<BR>
</FONT> <=
FONT COLOR=3D"#0000FF"><B>if</B></FONT> <FONT COLOR=3D"#408000">thePhone</FONT> =
=3D "" <FONT COLOR=3D"#0000FF"><B>then</B></FONT> <FONT COLOR=3D"#0000FF=
"><B>set</B></FONT> <FONT COLOR=3D"#408000">thePhone</FONT> <FONT COLOR=3D"#0000=
FF"><B>to</B></FONT> <FONT COLOR=3D"#0000FF">home phone number</FONT> <FONT CO=
LOR=3D"#0000FF"><B>of</B></FONT> <FONT COLOR=3D"#408000">theContact<BR>
</FONT> <=
FONT COLOR=3D"#0000FF"><B>set</B></FONT> <FONT COLOR=3D"#408000">theText</FONT> =
<FONT COLOR=3D"#0000FF"><B>to</B></FONT> "Call " & <FONT COLOR=3D"=
#408000">theName</FONT> & ", " & <FONT COLOR=3D"#408000">the=
Phone<BR>
</FONT> <=
FONT COLOR=3D"#0000FF"><B>set</B></FONT> {<FONT COLOR=3D"#408000">theCategories<=
/FONT>, <FONT COLOR=3D"#408000">theProjects</FONT>} <FONT COLOR=3D"#0000FF"><B>t=
o</B></FONT> <FONT COLOR=3D"#408000">theContact</FONT>'s {<FONT COLOR=3D"#0000FF=
">category</FONT>, <FONT COLOR=3D"#0000FF">project list</FONT>}<BR>
<FO=
NT COLOR=3D"#0000FF"><B>set</B></FONT> <FONT COLOR=3D"#408000">theTask</FONT> <F=
ONT COLOR=3D"#0000FF"><B>to</B></FONT> <FONT COLOR=3D"#0000FF">make</FONT> <FONT=
COLOR=3D"#0000FF">new</FONT> <FONT COLOR=3D"#0000FF">task</FONT> <FONT COLOR=3D"#=
0000FF">with properties</FONT> {<FONT COLOR=3D"#0000FF">name</FONT>:<FONT COLO=
R=3D"#408000">theName</FONT>, <FONT COLOR=3D"#0000FF">content</FONT>:<FONT COLOR=
=3D"#408000">theText</FONT>, <FONT COLOR=3D"#0000FF">category</FONT>:<FONT COLOR=
=3D"#408000">theCategories</FONT>, <FONT COLOR=3D"#0000FF">project list</FONT>:<=
FONT COLOR=3D"#408000">theProjects</FONT>}<BR>
<FO=
NT COLOR=3D"#0000FF">link</FONT> <FONT COLOR=3D"#408000">theTask</FONT> <FONT CO=
LOR=3D"#0000FF">to</FONT> <FONT COLOR=3D"#408000">theContact<BR>
</FONT> -=
-<FONT COLOR=3D"#4C4E4E"><I>open theTask<BR>
</I></FONT> <FONT COLOR=3D"#0000FF"=
><B>end</B></FONT> <FONT COLOR=3D"#0000FF"><B>repeat<BR>
</B></FONT> <FONT COLOR=3D"#0000FF"><B>end</B></FONT> <FONT=
COLOR=3D"#0000FF"><B>repeat<BR>
end</B></FONT> <FONT COLOR=3D"#0000FF"><B>tell<BR>
</B></FONT><BR>
<BR>
-- <BR>
Paul Berkowitz<BR>
MVP MacOffice<BR>
Entourage FAQ Page: <a href=3D"
http://www.entourage.mvps.org/faq/index.html">=
<
http://www.entourage.mvps.org/faq/index.html></a><BR>
AppleScripts for Entourage: <a href=3D"
http://macscripter.net/scriptbuilders/=
"><
http://macscripter.net/scriptbuilders/></a> <BR>
<BR>
Please "Reply To Newsgroup" to reply to this message. Emails will=
be ignored.<BR>
<BR>
PLEASE always state which version of Microsoft Office you are using - **200=
4**, X or 2001. It's often impossible to answer your questions otherwi=
se.<BR>
</SPAN></FONT>
</BODY>
</HTML>
--B_3193646402_13382746--