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

On Tue, Jun 25, 2024, at 4:14 PM, Nathaniel Irons wrote:
> 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
>
> -- 
> 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 "[email protected]" 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 [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/bbedit/038957d1-1ee2-405d-8adf-502643a6cf9e%40app.fastmail.com.

-- 
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 
"[email protected]" 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/824a46f8-379e-41a6-92cd-3cb0f9e28bf2%40app.fastmail.com.

Reply via email to