On Feb 26, 2017, at 08:32, Adrian Manea <[email protected] 
<mailto:[email protected]>> wrote:
> Right... I finally got it. It's much more than I described, but it covers all 
> of my needs, since sometimes I edit the same file today with Sublime, 
> tomorrow with BBEdit. :)


Hey Adrian,

Let's clean that up just a trifle.  :)

-------------------------------------------------------------------------------------------
set fileExtensionsToKeep to {"tex", "pdf", ".ist", "tags", "eps", "bbprojectd", 
".sublime-project", "sublime-workspace", "txt", "html", "xml"}

tell application "BBEdit"
    tell front text window
        set fileOfDocument1 to (get its file) as alias
    end tell
end tell

tell application "Finder"
    set parentDirectory to parent of fileOfDocument1 as alias
    set filesToTrash to (every file of folder parentDirectory whose name 
extension is not in fileExtensionsToKeep and name is not "tags" and name is not 
"indices.ist") as alias list
    set numberOfFilesToTrash to length of filesToTrash
    
    delete filesToTrash -- send to Trash
    
end tell

display notification ((numberOfFilesToTrash as text) & " files have been sent 
to the Trash") with title "AppleScript run from BBEdit" sound name "Tink"
-------------------------------------------------------------------------------------------

Whose clauses in the Finder get progressively slower as the number of items in 
a given folder goes up.

If this is sufficiently fast for your needs then great – if not then talk to me.

--
Take Care,
Chris

-- 
This is the BBEdit Talk public discussion group. If you have a 
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to