Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppleScript to Javascript

What is the equivalent below code in Javascript? Is this apple script convertable to java script?

tell application "Finder"
    activate
    set position of Finder window 1 to {607, 276}
    close Finder window 1
end tell

Thanks.

like image 820
mh taqia Avatar asked Feb 20 '23 22:02

mh taqia


1 Answers

Since the release of OS X Yosemite, JavaScript is available to automation.

The equivalent of your code would be:

var finder = Application('Finder');

finder.activate();
finder.windows[0].position = {x: 607, y: 276};
finder.windows[0].close();
like image 88
blvz Avatar answered Feb 26 '23 17:02

blvz