Repository navigation
add applescript support - #527
Conversation
|
Cool! A few questions:
Once we merge this we can clean up the evaluateJavaScript bit and use a supported API for that. Also, could you send us a signed contributor agreement? (see https://github.com/rstudio/rstudio/blob/master/CONTRIBUTING.md). |
PS: sent you the agreement. |
|
So for #3 it just fails entirely? (or does it route to one of the instances) |
|
Assuming that |
|
I just tried. It will always trigger the first instance. R GUI uses |
|
I think we should use cmd to be consistent with R GUI (that will allow On Fri, Nov 13, 2015 at 5:09 PM, Randy Lai [email protected] wrote:
|
|
True. I have renamed the command as tell application "RStudio"
cmd "a=1"
end tell |
|
Great, thanks! I'll merge this and tweak the evaulateJavascript part over the weekend or early next week. |
|
The original javascript doesn't handle successive cmd's correctly (successive cmd's will fire near at the same time, and because javascript is event-based, the cmd's are evaluated asynchronically). The updated javascript uses a queue and adds a little bit delay between cmd's so that the console has enough time to response. The old code fails to run this in the expected order: tell application "RStudio"
repeat with i from 1 to 10
cmd i
end repeat
end tellBesides, I tried the multiple instance thing again. If multiple instances of RStudio are opened, the R code will be sent to a random instance and it could be the last opened instance, or the first. I have no clue to predict where it will be sent...(R GUI suffers from the same issue.) |
|
Thanks! Hopefully when I make the change to call directly into the IDE On Sat, Nov 14, 2015 at 1:32 AM, Randy Lai [email protected] wrote:
|
|
Thank you for merging this. But I find that the internals also don't handle successive cmd's correctly. The cmd's are evaluated asychnocially, PS: I cannot find any link to report bugs. The issue page on github is disabled and support.rstudio.com only has feature requests and troubleshooting. |
|
Bugs are reported on support.rstudio.com (apologize that this isn't more I'm not able to reproduce the behavior that you are seeing (for me the The communication from our Cocoa front end to JavaScript is definitely Are you absolutely positive that you are testing against the right version? On Sat, Nov 14, 2015 at 3:52 PM, Randy Lai [email protected] wrote:
|
|
Okay, you are indeed correct! I think the problem is out of order delivery of rpc calls to the server (I confirmed that even when they appear out of order they were sent in order). This isn't shocking as there is nothing about http that guarantees in order delivery. My fix is essentially the same one that you put in (100ms delay executed within a command queue): ac9a422 |
|
@randy3k I see the following error message in the console when starting up RStudio (in development mode) on OS X Yosemite: Is there something else we need to do in Info.plist to prevent this error? |
|
@jjallaire |
|
I'm thinking that this might just be an artifact of running in debug mode On Thu, Jan 7, 2016 at 10:28 PM, Randy Lai [email protected] wrote:
|


It is a hack to implement applescript support. Basically it uses
MainFrameController evaluateJavaScriptto run a piece of javascript which pastes and runs the R code at the console.The implementation may be hacky, but it works.