Re: Can't launch BBEdit

2021-04-14 Thread @lbutlr
On 11 Apr 2021, at 09:28, Patrick Woolsey  wrote:
> For general reference, if you've asked BBEdit to bite off more than it can 
> reasonably chew :-), please see the section "Launching BBEdit" (pg 44 in the 
> current edition) within Chapter 3 of the user manual[*]: 

I didn't have the manual saved off and couldn’t remember where it was stored, 
so I could not access it from the help menu because I could not open Bbedit, so 
I guessed. Fortunately I did not chose poorly (this time).


-- 
Beautiful dawn / Lights up the shore for me / There is nothing else
in the world I'd rather see with you.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/925EA567-B53C-4BA5-8EC7-6EED41FA6ECA%40kreme.com.


Re: Applescript - move to end of document

2021-04-14 Thread Christopher Stone
On 04/14/2021, at 11:28, Rich Siegel mailto:sie...@barebones.com>> wrote:
> This should work:
> 
>   tell app "BBEdit"
>   activate
>   open file_path
>   select insertion point after last character of document 1
>   end tell
> 
> (It's best to always target documents, rather than windows; though that's not 
> the proximate issue here. "document 1" is always the active document.)


Hey Folks,

Here's another method:

tell application "BBEdit"
tell text of front document
select insertion point after it
end tell
end tell

I nearly always prefer to use tell-blocks to reference objects rather than 
one-liners, because frequently when I forget to do so I end up having to 
refactor my code when I add or change something.

For this use-case I might do something like this:

tell application "BBEdit"
tell front document
tell its text to select insertion point after it
end tell
end tell

But if I will take time to write the code “correctly”:

tell application "BBEdit"
tell front document
tell its text
select insertion point after it
end tell
end tell
end tell

Then I have no problem coming back in later and doing more with either the 
document, or the text, or both.

Probably 8 times out of 10 I'll regret not using the above construct, because a 
short time later I'll be modifying it to something on the order of this:

tell application "BBEdit"
tell front document
tell its text
set after it to linefeed & "Some more text..."
select insertion point after it
end tell
end tell
end tell

--
Best Regards,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/F3E41D7C-4B81-4927-AC38-861DCD9EC0A1%40gmail.com.


Re: Maximise Window from applescript?

2021-04-14 Thread Rob Russell
Thanks Jean,

I don't know how many times I looked at the Window and view menus, and 
never saw "Enter Full Screen"  

so my toggle distraction mode script now looks like:
tell application "BBEdit"
activate
try
set win to text window 1
tell win
set show gutter to (not show gutter)
set show navigation bar to (not show navigation bar)
set sidebar visible to (not sidebar visible)
set show line numbers to (not show line numbers)
tell application "System Events"
tell process "BBEdit"
set frontmost to true  -- is this redundant?
try
click menu item "Enter Full Screen" of menu "View" of menu bar item "View" 
of menu bar 1
on error
click menu item "Exit Full Screen" of menu "View" of menu bar item "View" 
of menu bar 1
end try
end tell
end tell
end tell
on error str
display alert str
end try
end tell

save that script to my FastScripts folder, give it a shortcut 
ctrl-shift-option-D and it works a treat.

Thanks all.

Rob



On Wednesday, 14 April 2021 at 20:31:24 UTC+12 jj wrote:

> Hi Rob,
>
> This AppleScript seems to do the trick.
>
> ```applescript
> use AppleScript version "2.7"
> use scripting additions
> tell application "BBEdit"
> activate
> tell application "System Events"
> try
> tell process "BBEdit"
> set frontmost to true
> click menu item "Enter Full Screen" of menu "View" of 
> menu bar item "View" of menu bar 1
> end tell
> on error aMessage
> display dialog aMessage
> end try
> end tell
> 
> end tell
> ```
>
> HTH,
>
> Jean Jourdain
>

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/5b800631-52b1-4bb5-afab-c182da8570c6n%40googlegroups.com.


Re: Applescript - move to end of document

2021-04-14 Thread Jan Erik Moström

On 14 Apr 2021, at 18:28, Rich Siegel wrote:


This should work:

tell app "BBEdit"
activate
open file_path
select insertion point after last character of document 1
end tell

(It's best to always target documents, rather than windows; though 
that's not the proximate issue here. "document 1" is always the active 
document.)


Thank you! I'm trying to get back into AppleScript to do some automation 
... and I've forgotten most of what I knew about AS.


= jem

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "supp...@barebones.com" rather than posting here. 
Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/4E953304-6E3D-45BD-9062-442DFD519E3B%40mostrom.pp.se.


Re: Applescript - move to end of document

2021-04-14 Thread Rich Siegel

On 14 Apr 2021, at 12:22, Jan Erik Moström wrote:

Basic AppleScript question: How do I move the insertion point to the 
end of the current document?


I tried with something like this

tell application "BBEdit"
activate
open file_path
tell front window
select character after endLine
end tell
end tell

or "insertion point" but I'm doing it wrong. Could someone enlighten 
me how to do this?


This should work:

tell app "BBEdit"
activate
open file_path
select insertion point after last character of document 1
end tell

(It's best to always target documents, rather than windows; though 
that's not the proximate issue here. "document 1" is always the active 
document.)


R.

--
Rich Siegel Bare Bones Software, Inc.
  

Someday I'll look back on all this and laugh... until they sedate me.

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "supp...@barebones.com" rather than posting here. 
Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/A97D238B-D906-4410-863A-947AABF33280%40barebones.com.


Applescript - move to end of document

2021-04-14 Thread Jan Erik Moström
Basic AppleScript question: How do I move the insertion point to the end 
of the current document?


I tried with something like this

tell application "BBEdit"
activate
open file_path
tell front window
select character after endLine
end tell
end tell

or "insertion point" but I'm doing it wrong. Could someone enlighten me 
how to do this?


= jem

--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "supp...@barebones.com" rather than posting here. 
Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/F85B1344-A97E-49FA-A41F-701D21F9A58F%40mostrom.pp.se.


Re: Maximise Window from applescript?

2021-04-14 Thread jj
Hi Rob,

This AppleScript seems to do the trick.

```applescript
use AppleScript version "2.7"
use scripting additions
tell application "BBEdit"
activate
tell application "System Events"
try
tell process "BBEdit"
set frontmost to true
click menu item "Enter Full Screen" of menu "View" of 
menu bar item "View" of menu bar 1
end tell
on error aMessage
display dialog aMessage
end try
end tell

end tell
```

HTH,

Jean Jourdain

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: 
--- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/9d974180-837f-4482-9a40-8deac7c70e2an%40googlegroups.com.