The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   Paste any lines in Clipboard as new tasks (http://forums.omnigroup.com/showthread.php?t=4883)

RobTrew 2007-09-16 06:07 AM

Paste any lines in Clipboard as new tasks
 
In partial response to a posting under Applescript Requests:

[QUOTE]I'd like it if I had a list, (as might come from an email)
Like:
1. Please do this
2. Please do that
3. Oh, and this other thing.

I'd like to select the list, hit a button and have three new actions created.[/QUOTE]

Here is a draft script which appends any lines of text in the clipboard as children of the project or task which is currently selected in Omnifocus.

i.e. you would need to tap CMD-C to capture text lines into the clipboard, and then run this script.

Not outstandingly useful, it has to be said, as Omnifocus does quite a good job of pasting text lines anyway :-)

leehinde 2007-09-17 12:14 PM

I'll give it a try. Thanks very much.

leehinde 2007-09-17 12:25 PM

That works exactly right. Thanks again.

amelchi 2011-06-05 01:23 PM

Hello Rob,

would it be possible to use your applescript for Ical?
thanks

amelchi

RobTrew 2011-06-05 02:21 PM

[QUOTE=amelchi;98299]would it be possible to use your applescript for Ical?[/QUOTE]

No - that kind of script is application-specific.

Not quite sure what you are trying to do. Dumping lines from the clipboard into the to do list of the first iCal calendar might look something like the following, but iCal is not really my thing, I'm afraid.

[CODE]try
set lstLines to paragraphs of (Unicode text of (the clipboard as record))
on error
tell application id "sevs" to display alert "No text lines in clipboard"
return
end try

set lngLines to length of lstLines
if lngLines < 1 then return

tell application id "com.apple.iCal"
activate
tell first calendar
repeat with oLine in lstLines
make new todo with properties {summary:oLine}
end repeat
set strCal to name
end tell

display alert (lngLines as string) & " To Do item(s) added to calendar: " & strCal
end tell[/CODE]

amelchi 2011-06-08 06:06 AM

thanks a lot... it is just perfect!

amelchi

amelchi 2011-06-08 06:09 AM

just curious... what do you use as calendar app? on the mac

thanks

amelchi

RobTrew 2011-06-08 02:28 PM

[QUOTE=amelchi;98386]what do you use as calendar app?[/QUOTE]

I do use iCal. I just mean that I've never really needed to look at its applescript library - it's good enough for the simple use I make of it.

amelchi 2011-06-09 07:34 AM

actually I find the Ical search options too weak... only reason to move on to BusyCal

RobTrew 2011-06-09 10:06 PM

[QUOTE=amelchi;98408]only reason to move on to BusyCal[/QUOTE]

BusyCal certainly looks well designed, but it may not be the best option for scripted integration with OmniFocus.

It does implement the very simple application-independent applescript basics, but unlike iCal it doesn't have its own applescript suite, offering access to the application data.

A script like the one above, for example, could not be written for the current version of BusyCal ...


All times are GMT -8. The time now is 10:33 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.