Applescripting Outliner
Michael Scheurer
lists at michaelscheurer.com
Wed Jun 19 15:18:01 PDT 2002
Hi all,
has anyone written any interesting Applescript for Outliner they'd like to
share?
I find the best way to learn about a new app is to look at other scripts.
So here is something I fudged together...
This script takes a completed item from Outliner and creates a completed
task in Entourage X, feel free to post any improvements. :)
-- by Michael Scheurer
tell application "OmniOutliner"
set theList to every child of document 1 whose state is checked
set theDate to current date
repeat with anItem in theList
set theTopic to the topic of anItem
set theNote to the note of anItem
set theTaskSubject to paragraph 1 of theTopic
try
set theContent to texts from paragraph 2 to character -1 of ¬
theTopic
on error
set theContent to ""
end try
set theNewContent to my replaceText(theContent, "
", return)
set theNewNote to my replaceText(theNote, "
", return)
tell application "Microsoft Entourage"
set newTask to make new task with properties¬
{name:theTaskSubject, content:(theNewContent & return & return & "Note:" &¬
return & theNewNote), completed:true, due date:theDate}
end tell
end repeat
delete (every child of document 1 whose state is checked)
end tell
-- Subroutine by Shane Stanley, sstanley at myriad-com.com.au
on replaceText(theData, FindText, replaceText)
set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to {FindText}
set tempList to text items of theData
set AppleScript's text item delimiters to {replaceText}
set theData to tempList as string
set AppleScript's text item delimiters to oldDelims
return theData
end replaceText
cheers
michael
--
Michael Scheurer Consulting Mobile: 0419 554 495
ABN 28 341 745 738 -- http://www.michaelscheurer.com
More information about the OmniOutliner-Users
mailing list