The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   AppleScripting Omni Apps (http://forums.omnigroup.com/forumdisplay.php?f=46)
-   -   AppleScript help needed for ow5 & oo3 (http://forums.omnigroup.com/showthread.php?t=7585)

sangheeta 2008-03-24 01:08 AM

AppleScript help needed for ow5 & oo3
 
Hello,
I often save some text from websites, like articles or tutorials in a very organized OmniOutliner document, by creating a new row for title, then a new row for the text, for a code etc.

[CODE]tell application "OmniWeb"
activate
tell application "System Events" to keystroke "c" using command down
end tell
tell application "OmniOutliner"
activate
tell application "System Events"
keystroke return
keystroke "v" using command down
end tell
end tell
tell application "OmniWeb" to activate[/CODE]

It works pretty well for me, I can this way for example highlight the text and paste it in a new row in oo3. Then, I go back in oo3 to organize all my news titles rows and texts rows to have my well organized oo3 file, like for example, an all applescripts tutorials oo3 file I found on the web. ;-)

I know it is a very basic script, but maybe some of you can help me to make it more "expert like" or to make it more powerfull.

thank you.

troyb 2008-04-01 04:19 PM

I might do something like this:

[CODE]
tell application "OmniWeb"
activate
tell application "System Events" to keystroke "c" using command down
set pageTitle to name of front browser as text
end tell
set mySelection to the clipboard
tell application "OmniOutliner Professional"
set myDoc to first document whose name contains "webclips"
tell myDoc
set myRow to make new row at end of rows
set value of cell 2 of myRow to pageTitle as text
set value of note cell of myRow to mySelection
set note expanded of myRow to true
end tell
end tell
[/CODE]

sangheeta 2008-04-03 12:26 PM

Thank you Troyb for this script.:)
The omnioutliner section is interresting for me.
But the line "set myDoc to first document whose name contains "webclips"" make me to have an oo3 document named "webclips" opened.

troyb 2008-04-03 01:04 PM

Yes, sorry, that line is looking for an open OmniOutliner document that is named webclips. I did this instead of just asking OmniOutliner to activate since my desired document may not be the frontmost window. You can of course name webclips to anything you like if you were to do something like this.


All times are GMT -8. The time now is 04:54 AM.

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