Hey Folks,

Just in case anyone besides Adrian cares.

I was able to write him a UI-Script that grabs the selected label in the 
named-labels sheet and inserts it at the cursor in the front document.

-------------------------------------------------------------------------------------------
# Auth: Christopher Stone <[email protected] 
<mailto:[email protected]>>
# Clnt: Adrian Manea from BBEdit-Talk.
# dCre: 2017/01/20 23:44
# dMod: 2017/01/20 23:55
# Appl: BBEdit
# Task: Insert Named Symbol at the selection in front BBEdit document.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @BBEdit, @System_Events, @Insert, @Named, 
@Symbol, @Selection, @Cursor, @Document
# Vers: 1.0
-------------------------------------------------------------------------------------------

try
   
   tell application "System Events"
      tell application process "BBEdit"
         tell (first window whose subrole is "AXStandardWindow")
            tell sheet 1
               tell table 1 of scroll area 1
                  tell (first row whose selected is true)
                     set theLabel to value of first static text
                  end tell
               end tell
               tell button "Cancel"
                  perform action "AXPress"
               end tell
            end tell
         end tell
      end tell
   end tell
   
   if theLabel ≠ "" then
      tell application "BBEdit"
         set text of selection to theLabel
      end tell
   end if
   
on error
   beep
end try

-------------------------------------------------------------------------------------------

USAGE:

1) Bring up your named-symbols-sheet.
2) Pick one by searching or other means.
3) Activate the hotkey for the AppleScript.

The sheet will be dismissed, and the named-label will be inserted in the front 
document at the cursor (or will replace any selected text).

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to