Does anyone know if it's possible to script pasting from the clipboard to the current cursor location in a note? I'm a PHP guy, but can get around in applescript if someone can provide an example.
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!
|
|
FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
Applescript to Paste from Clipboard | Thread Tools | Search this Thread | Display Modes |
|
Member
2010-12-13, 12:58 PM
Does anyone know if it's possible to script pasting from the clipboard to the current cursor location in a note? I'm a PHP guy, but can get around in applescript if someone can provide an example.
Post 1
|
Member
2010-12-13, 02:22 PM
The following snippet illustrates the process by setting the clipboard contents to "Hi Mom!" and then pasting them into the insertion point in the frontmost OmniFocus window by simulating the user pressing command-V.
Code:
set the clipboard to "Hi Mom!" tell application "OmniFocus" activate tell application "System Events" keystroke "v" using {command down} end tell end tell
Post 2
|
Guest
2010-12-13, 03:00 PM
and, FWIW, you can get formatted text by combining simple html markup with the textutil and pbcopy commands.
Code:
do shell script "echo " & quoted form of "<i>Hello</i> Mom!" & ¬ " | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf" tell application id "com.omnigroup.omnifocus" activate tell application id "com.apple.systemevents" keystroke "v" using {command down} end tell end tell
Post 3
|
Thread Tools | Search this Thread |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Paste any lines in Clipboard as new tasks | RobTrew | OmniFocus Extras | 25 | 2011-09-16 01:07 PM |
Applescript to capture list of actions to clipboard | JohnJ80 | OmniFocus Extras | 20 | 2011-03-25 10:19 AM |
Applescript to Save Clipboard to Clippings? | jamespro | OmniOutliner 3 for Mac | 0 | 2011-03-23 11:11 AM |
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 |