Scripting Tunnelblick with JXA

6 views
Skip to first unread message

dean...@deanishe.net

unread,
Dec 16, 2017, 5:04:27 PM12/16/17
to tunnelblick-discuss
Hi,

I'm trying to script Tunnelblick with JXA, but I'm having difficulty translating the AppleScript examples to JavaScript.

The problem is that, while in most applications you can read their properties directly, in Tunnelblick you have to call get on everything.

So, these don't work:

repeat with theItem in items

for (var i = 0; i < items.length; i++) {
  var item = items[i]
}

And I can't figure out how this translates to JXA:

repeat with theItem in (get items)

Can anyone help?

Thanks,
Dean
Reply all
Reply to author
Forward
0 new messages