e.g.
Code:
property pCreatorCode : "OOut"
tell application id "com.apple.systemevents"
try
set procOO to first process where creator type is pCreatorCode
on error
display dialog "OmniOutliner is not running"
return
end try
set strName to name of procOO
end tell
set strScript to "
script
on CountRows()
tell application " & quote & strName & quote & "
if count of documents > 0 then
tell front document
set strMsg to \"Number of rows in \" & name as string & \" is \" & (count of rows) as string
display dialog strMsg
end tell
end if
end tell
end CountRows
end script
"
set oScript to run script strScript
CountRows() of oScript