applying a text factory via a script

23 views
Skip to first unread message

Nathaniel Irons

unread,
Jun 25, 2024, 7:16:06 PM (4 days ago) Jun 25
to bbe...@googlegroups.com
Hello,

To the best my of ability to tell, this should apply the specified text factory to the frontmost BBEdit window (assuming it's a text document):

tell application "BBEdit"
set tf to alias "Macintosh HD:Users:irons:example.textfactory"
apply text factory tf to text document 1 of text window 1 without saving
end tell

However, I find that this script runs without error and has no effect. If I click the Choose button in the text factory and select this same target file, then running the text factory does succeed.

I confirmed that "text window 1" is what I expect it to be via:

tell application "BBEdit" to get URL of text document 1 of text window 1

Am I overlooking something? MacOS 14.5, BBEdit 15.1.1.

Thanks,

Nat

Nathaniel Irons

unread,
Jun 26, 2024, 12:32:55 PM (3 days ago) Jun 26
to bbe...@googlegroups.com
This was apparently one of those "works right after I hit send" questions. I couldn't remember why I specified "alias" when declaring the tf variable, so I removed it, and then the script succeeded. And continued succeeding after I put the alias specifier back. Argh.

Nat
> --
> This is the BBEdit Talk public discussion group. If you have a feature
> request or believe that the application isn't working correctly, please
> email "sup...@barebones.com" rather than posting here. Follow @bbedit
> on Mastodon: <https://mastodon.social/@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/038957d1-1ee2-405d-8adf-502643a6cf9e%40app.fastmail.com.
Reply all
Reply to author
Forward
0 new messages