I have the following AppleScript to execute het selected text in R and 
return the focus to BBEdit:

*tell* *application* "BBEdit"

*set* the_selection *to* (selection *of* *front* *window* *as* *string*)

*if* (the_selection) *is* "" *then*

*try*

*set* the_selection *to* *line* (*get* startLine *of* selection) *of* 
*front* *window* *as* *string*

*on* *error*

*display dialog* "The active window must be an editor window, with a file 
opened. You want to run something in R? Well, tell me what!" with icon 
*note* buttons {"Got it!"} default button 1

*error* number -128

*end* *try*

*end* *if*

*end* *tell*


*tell* *application* "R"

*cmd* the_selection

*end* *tell*


*tell* *application* "System Events"

*tell* *process* "BBEdit"

*set* frontmost *to* *true*

*end* *tell*

*end* *tell*
Now I would like to set the cursor in BBEDit to the next line after the 
selected text ore line it is in.

an I do this?

Thanks,

Rainer

-- 
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: <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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/655cb19e-898a-4498-9cff-5bfcf4d1b210n%40googlegroups.com.

Reply via email to