functions list of the current file

49 views
Skip to first unread message

Dmitry Markman

unread,
Dec 11, 2023, 10:21:40 PM12/11/23
to bbe...@googlegroups.com
Hi
how I can get functions list of the current C++ source file?

I wrote simple AppleSctipt

tell application "BBEdit"

set fl to functions list

open fl

end tell


and that script opens floating window, but all properties related to text, content are missings, 
so I can’t get text of the window and get function as a list (text)

{
ID:108, 
document:missing value, 
bounds:{1312, 430, 1597, 769}, 
closeable:true, 
collapsed:false, 
index:15, 
modal:false, 
file:missing value, 
modified:false, 
name:"Functions”, 
position:{1312, 430}, 
resizable:true, 
selection:missing value, 
contents:missing value, 
text:missing value, 
titled:false, 
visible:false, 
zoomable:true, 
zoomed:false, 
container:current application
}

thanks in advance

dm

Rich Siegel

unread,
Dec 11, 2023, 10:25:34 PM12/11/23
to 'Dmitry Markman' via BBEdit Talk
On 11 Dec 2023, at 19:43, 'Dmitry Markman' via BBEdit Talk wrote:

> Hi
> how I can get functions list of the current C++ source file?
>
> I wrote simple AppleSctipt
>
> tell application "BBEdit"
> set fl to functions list
> open fl
> end tell
>
> and that script opens floating window, but all properties related to text, content are missings,
> so I can’t get text of the window and get function as a list (text)

The "functions list" application property is simply the scripting accessor for the Functions palette itself. I regret there is no access to individual functions in a file through the scripting model.

R.

Dmitry Markman

unread,
Dec 12, 2023, 8:33:33 AM12/12/23
to bbe...@googlegroups.com
Hi Rich, thanks, I see

just to close the loop, 

I managed to get list of functions with some ugly script, but it worked:

tell application "BBEdit"

activate

set fl to functions list

open fl

tell application "System Events"

tell process "BBEdit"

set w to window "Functions"

set sa to scroll area 1 of w

set t to table 1 of sa

set r to count of rows of t

set idx to 1

repeat r times

set r1 to row idx of t

set selected of r1 to true

set tf to value of text field 1 of r1

set log_str to (idx as string) & " " & (tf as string)

log log_str

set idx to idx + 1

end repeat

end tell

end tell

end tell


it returned

(*1 function_name*)
. . . . . . . . 
(*149 function_name*)

thanks again

dm

-- 
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Twitter: <https://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 bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/3309A6F5-8F1D-4470-8A2E-9A9D4F69D869%40barebones.com.

Reply all
Reply to author
Forward
0 new messages