Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

execString()'s callback can not be called when run in child_process of node? #4

Closed
chuanhuizhang opened this issue Jun 12, 2014 · 3 comments

Comments

@chuanhuizhang
Copy link

I run execString("some applescript", function(){"printout"});
But the callback function doesn't work while the applescript has been execute!
Can someone please give me a help?

@TooTallNate
Copy link
Owner

Can you give me some complete code to repro the issue?

@clarkieryan
Copy link

Might be able to shed some light - a year on. Using a simple process.nextTick() loop causes a similar issue.

var loop = function(){ //Exec here process.nextTick(loop); }; process.nextTick(loop);

@sonicdoe
Copy link
Collaborator

@clarkieryan Do you mean something like the following?

process.nextTick(() => {
  applescript.execString('tell application "iTunes" to get name of selection', (err, result) => {
    console.log(result)
  })
})

This works fine for me in Node.js v10 (and even Node.js v4).

Anyway, since another two years have passed, I’m going to close this. If anyone can still reproduce this issue, let me know and I’ll reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants