I’ve been trying to get the selected record from DNtp but the normal methods for getting the active window aren’t working for me.
The window is always the first one I opened starting DNtp; the selection if of course for that window.
Have I missed something?
tell application id "DNtp"
-- set mWin to the front window
set mWin to window 1
log "Front window is: " & name of mWin as string
set mSel to the selection of mWin
end tell
Check the Applescript dictionary. Look for “selection” and you’ll see it’s a property of: the application, a search window, or a viewer window.
Note that selection returns a list, even a list of one.
PS: there are no “normal methods” (though there may be common ones). Applescript is implemented as each developer sees fit (and many don’t even allow for a selection property).