The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Today's Posts

 
Paste any lines in Clipboard as new tasks Thread Tools Search this Thread Display Modes
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.
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 :-)

Last edited by RobTrew; 2011-07-05 at 07:46 AM..
 
I'll give it a try. Thanks very much.
 
That works exactly right. Thanks again.
 
Hello Rob,

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

amelchi
 
Quote:
Originally Posted by amelchi View Post
would it be possible to use your applescript for Ical?
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
 
thanks a lot... it is just perfect!

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

thanks

amelchi
 
Quote:
Originally Posted by amelchi View Post
what do you use as calendar app?
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.
 
Hello RobTrew,

where is your original script?

thanks

amelchi
 
Good question.

It probably looked sth like this:
Code:
try
	set lstLines to paragraphs of (Unicode text of (the clipboard as record))
on error
	tell application id "sevs"
		activate
		display alert "No text lines in clipboard"
	end tell
	return
end try

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

tell application id "OFOC"
	activate
	tell front document window of front document
		repeat with oPanel in {content, sidebar}
			set lstTrees to (selected trees of oPanel where class of its value ≠ item and class of its value ≠ folder and class of its value ≠ context)
			set lngTrees to count of lstTrees
			if lngTrees > 0 then exit repeat
		end repeat
		if lngTrees < 1 then return
		set oTree to first item of lstTrees
		set oParent to value of oTree
		tell oParent
			repeat with oLine in lstLines
				make new task with properties {name:oLine}
			end repeat
		end tell
	end tell
	
	tell oPanel to set expanded of oTree to true
end tell
 
 




Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Lines from Thunderbird/Mail as tasks chiborg OmniFocus 1 for Mac 1 2012-04-26 09:04 AM
Applescript to Save Clipboard to Clippings? jamespro OmniOutliner 3 for Mac 0 2011-03-23 11:11 AM
Applescript to Paste from Clipboard richgoidel OmniFocus Extras 2 2010-12-13 03:00 PM
Copy Actions and/or Projects to Clipboard carlsson OmniFocus 1 for Mac 3 2010-05-31 12:27 AM
Open Tab with URL in clipboard eps5 OmniWeb Feature Requests 2 2008-11-10 06:40 PM


All times are GMT -8. The time now is 04:17 PM.


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