AppleScript to compare two frontmost documents

2024-03-20 Thread Gil Dawson
Glad to hear that BBEdit's AppleScript language is a little larger than the 
.sdef suggests.

I hadn't thought about looking at Script Editor's recording result.  Great idea!

Thanks, guys.

--Gil

> On Mar 20, 2024, at 1:58 PM, GP  wrote:
> 
> If you use the Script Editor to record BBEdit's Find Differences -> Compare 
> Two Front Windows command you'll find the recording is something like:
> 
> tell application "BBEdit"
>   activate
>   compare text document id 717 against text document id 716 options 
> {ignore blank lines:true, ignore RCS keywords:true, ignore leading 
> spaces:true, ignore trailing spaces:true, ignore extra spaces:true}
> end tell
> 
> Where the text document id's are those associated with window index 1 and 
> window index 2 in the windows class. In my example, one of the comparison 
> windows was for an untitled, never saved text window with no file property.
> 
> So, you don't strictly need an on disk file parameter for BBEdit's 
> AppleScript compare command parameters.


>> On Mar 20, 2024, at 1:28 PM, Fletcher Sandbeck  wrote:
>> 
>> You can get the "first text document", "second text document", etc. so a 
>> command like this will compare the front two windows.
>> 
>> tell application "BBEdit"
>>  activate
>>  compare first text document against second text document options {ignore 
>> RCS keywords:true, ignore all spaces:true}
>> end tell
> 
> 
>>> Is there AppleScript language in BBEdit 14.6.9 equivalent to Search > Find 
>>> Differences > Compare Two Front Windows?  The .sdef suggests only files and 
>>> folders:
>>> 
>>> compare v : compares two files or folders
>>> compare file 
>>>  : 
>>> the new file/folder
>>> against file 
>>>  : 
>>> the old file/folder
>>> [options Compare Options 
>>> ]
>>>  : comparison options
>>> [file_filter filter 
>>> ] 
>>> : file filtering criteria (for multi-file compare)
>>> [folder_filter filter 
>>> ] 
>>> : folder filtering criteria (for multi-file compare)
>>> → Compare Results 
>>> 
>>>  : information about the compare results

-- 
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/DC963C40-98D2-4A07-B0BC-0D2BA2895CF8%40GilDawson.com.


Re: AppleScript to compare two frontmost documents

2024-03-20 Thread GP
If you use the Script Editor to record BBEdit's Find Differences -> Compare 
Two Front Windows command you'll find the recording is something like:

tell application "BBEdit"
activate
compare text document id 717 against text document id 716 options {ignore 
blank lines:true, ignore RCS keywords:true, ignore leading spaces:true, 
ignore trailing spaces:true, ignore extra spaces:true}
end tell

Where the text document id's are those associated with window index 1 and 
window index 2 in the windows class. In my example, one of the comparison 
windows was for an untitled, never saved text window with no file property.

So, you don't strictly need an on disk file parameter for BBEdit's 
AppleScript compare command parameters.
On Wednesday, March 20, 2024 at 1:01:38 PM UTC-7 Gil Dawson wrote:

> Is there AppleScript language in BBEdit 14.6.9 equivalent to Search > Find 
> Differences > Compare Two Front Windows?  The .sdef suggests only files and 
> folders:
>
> compare v : compares two files or folders
>
> compare file : the new file/folder
>
> against file : the old file/folder
>
> [options Compare Options] : comparison options
>
> [file_filter filter] : file filtering criteria (for multi-file compare)
>
> [folder_filter filter] : folder filtering criteria (for multi-file 
> compare)
>
> → Compare Results : information about the compare results
>
>

-- 
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/208ca38d-5380-4c40-bb0c-b7d9bf4f56e3n%40googlegroups.com.


Re: AppleScript to compare two frontmost documents

2024-03-20 Thread Fletcher Sandbeck
You can get the "first text document", "second text document", etc. so a 
command like this will compare the front two windows.

tell application "BBEdit"
  activate
  compare first text document against second text document options {ignore RCS 
keywords:true, ignore all spaces:true}
end tell

[fletcher]

> On Mar 20, 2024, at 11:13 AM, Gil Dawson  wrote:
> 
> Is there AppleScript language in BBEdit 14.6.9 equivalent to Search > Find 
> Differences > Compare Two Front Windows?  The .sdef suggests only files and 
> folders:
> 
> compare v : compares two files or folders
> compare file : the new file/folder
> against file : the old file/folder
> [options Compare Options] : comparison options
> [file_filter filter] : file filtering criteria (for multi-file compare)
> [folder_filter filter] : folder filtering criteria (for multi-file compare)
> → Compare Results : information about the compare results
> 
> -- 
> 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/245D47C8-DCE5-47A0-9920-4EEA04F00969%40GilDawson.com.

-- 
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/B639D7BE-F282-488E-97B2-014F24C81828%40cumuli.com.


AppleScript to compare two frontmost documents

2024-03-20 Thread Gil Dawson
Is there AppleScript language in BBEdit 14.6.9 equivalent to Search > Find 
Differences > Compare Two Front Windows?  The .sdef suggests only files and 
folders:

compare v : compares two files or folders
compare file 
 : the 
new file/folder
against file 
 : the 
old file/folder
[options Compare Options 
]
 : comparison options
[file_filter filter 
] : 
file filtering criteria (for multi-file compare)
[folder_filter filter 
] : 
folder filtering criteria (for multi-file compare)
→ Compare Results 

 : information about the compare results

-- 
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/245D47C8-DCE5-47A0-9920-4EEA04F00969%40GilDawson.com.