javascript-automation Questions

2

I am using OS X JavaScript for Automation (JXA), and I want to be able to capture the "open location" Apple Event. Per http://www.macosxautomation.com/applescript/linktrigger/ , I have setup a cus...
Tacklind asked 29/12, 2015 at 5:25

2

Solved

I would like use Javascript for Automation in OS X Yosemite to create a new email message in Mail.app and attach a file to the email. This is my code: Mail = Application('com.apple.Mail') message ...
Radioactivate asked 2/1, 2015 at 17:57

2

Solved

where can I find JXA documentation with all available classes, functions and parameters? After so far found just random code samples and short tutorials.
Homestretch asked 22/12, 2017 at 10:56

1

Solved

In a Mac mail rule, I am trying to run a javascript instead of an applescript. This has been asked in Mail Rules using JavaScript for Automation instead of AppleScript but the answer is not working...
Cocainism asked 5/3, 2018 at 18:32

1

Solved

I have an AppleScript script that is calling a shell command that I want to convert to JavaScript (JXA) but I don't see the equivalent of do shell script. Here is the script using AppleScript: ...
Playsuit asked 11/1, 2018 at 6:41

5

I would like the JXA equivalent of this AppleScript snippet: tell application "Finder" # Get path set currentTarget to target of window 1 set posixPath to (POSIX path of (currentTarget as alia...
Harlen asked 31/7, 2017 at 22:26

4

Solved

In short - what is the JavaScript for Mac Automation equivalent of AppleScript's as «class utf8» ? I have a unicode string that I'm trying to write to a text file using JavaScript for Mac Automati...
Idioblast asked 30/5, 2017 at 17:29

7

Solved

In AppleScript it’s possible to get the the POSIX path of the folder the current script is located in using this line: POSIX path of ((path to me as text) & "::") Example result: /Users/aaro...

3

I would like to start a subprocess in JavaScript for Automation (JXA) and send a string to that subprocess's stdin which might include newlines, shell metas, etc. Previous AppleScript approaches fo...
Robber asked 21/12, 2014 at 4:18

2

I'm trying to list all the methods of a JXA object. I've tried several methods that work with JavaScript in the browser, but none have worked: >> Object.getOwnPropertyNames(Application('Find...
Blane asked 27/1, 2017 at 22:7

4

Solved

Playing with the new JS for automation using Script Editor. I'm getting an error on the final line of the following: var iTunes = Application("iTunes"); var sources = iTunes.sources(); var library...
Rooster asked 22/11, 2014 at 1:16

2

Solved

How is it possible to listen for events in OS X JavaScript for automation. In the scripting Library for the Messages application there is a list of event handlers, such as messageSent and messageR...
Jacobjacoba asked 21/11, 2014 at 4:14

2

Solved

Using AppleScript I can call a shell script with: do shell script "echo 'Foo & Bar'" But I can't find a way to do this with JavaScript in the Yosemite Script Editor.
Craddock asked 20/1, 2015 at 11:55

2

Solved

I have a book on AppleScript that I'm wondering whether I should keep. I already know JavaScript. I understand that Apple added JavaScript scripting support into OS X recently. Does this mean tha...
Roumell asked 10/11, 2014 at 16:32

2

If I write a textfile using the standardadditions, I obviously can configure the encoding in a parameter bag. In AppleScript I would write «class utf8» but which value to use in JXA? I tried the St...
Salivate asked 16/3, 2015 at 12:34

1

In Yosemite it now is possible to use JavaScript for automation as well as Applescript. I am having trouble with certain StandardAdditions commands. E.g. from the Contacts application I can use dis...

3

Solved

I'm trying to port some old Applescript over to the new JavaScript syntax. Somethings seem to be pretty straight forward so : tell application "System Events" to keystroke "t" using command down ...
1

© 2022 - 2024 — McMap. All rights reserved.