LandonSchropp
LandonSchropp

Reputation: 10274

Translating AppleScript into rb-appscript

I'm trying to translate the following piece of code into Ruby using the rb-appscript gem:

tell application "System Events" to tell process "Dock"
    set dock_dimensions to size in list 1
    set dock_height to item 2 of dock_dimensions
end tell

I'm a little stuck. I can't figure out what to do with the list part. Here's what I have so far:

puts Appscript.app.by_name("System Events").processes["Dock"]

I'd appreciate any help.

Upvotes: 0

Views: 164

Answers (1)

jackjr300
jackjr300

Reputation: 7191

Like this :

puts Appscript.app.by_name("System Events").processes["Dock"].lists[0].size.get[1]

lists and size are array.

Upvotes: 1

Related Questions