AppleScript migration and Catalina!

53 views
Skip to first unread message

WaMa

unread,
Oct 13, 2019, 7:15:35 AM10/13/19
to BBEdit Talk
I'm going to be migrating from Tex-Edit to BBEdit -- long overdue -- but need some help rewriting some AppleScripts so they'll do the same thing in BBEdit. 

Could someone please help me here? How would this script, for instance, need to be written for BBEdit?

-----

tell application "Tex-Edit Plus"
activate
open file "HD:Users:wama:Desktop:file.txt"
set insertion point before contents of window 1 to "sku,product-id,product-id-type,Price,item-condition,Quantity,add-delete,will-ship-internationally,expedited-shipping,standard-plus,item-note
"
replace window 1 looking for "\"" replacing with ""
replace window 1 looking for "," replacing with "^t"
replace window 1 looking for "
" replacing with "
"
save window 1 with creator «class TBB6»
quit saving ask
end tell

Holger Bartel

unread,
Oct 14, 2019, 8:53:40 AM10/14/19
to BBEdit Talk
Hi, 

Have look into Text Factories which I believe should be able to accomplish what you are looking for. 

Best, 
Holger

--
This is the BBEdit Talk public discussion group. If you have a
feature request or need technical support, please email
"sup...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: <https://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 bbedit+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/80c71618-12d2-4d54-951e-de0ead6fcb8e%40googlegroups.com.

Rich Siegel

unread,
Oct 14, 2019, 10:17:55 AM10/14/19
to bbe...@googlegroups.com
On 10/14/19 at 1:29 AM, bbe...@googlegroups.com ('Holger Bartel'
via BBEdit Talk) wrote:

>Have look into Text Factories which I believe should be able to
>accomplish what you are looking for.

This is true. However, in cases where scripting is necessary,
the following may be useful to know:

1. BBEdit and Tex-Edit have very similar support for the AppleScript
text suite. They will differ in the details of some application-
specific verbs ("replace" is a good example), but in
general you
should be able to get pretty far by looking up a verb in
the Script
Editor's (or Script Debugger's) dictionary browser for BBEdit.

2. When scripting BBEdit, it's very important to avoid targeting
"window" objects for text operations. Instead, target a
document or
its text, as appropriate: "document 1" or "text of document
1" give
you the active document or its text, respectively.

R.
--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <http://www.barebones.com/>

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

Reply all
Reply to author
Forward
0 new messages