diff options
author | Aleix Conchillo FlaquƩ <aconchillo@gmail.com> | 2022-01-30 00:31:47 -0800 |
---|---|---|
committer | Aleix Conchillo FlaquƩ <aconchillo@gmail.com> | 2022-01-30 00:31:47 -0800 |
commit | ba5e1879b584bcbc21e7cb277aae0fea0c14fe0d (patch) | |
tree | cdc1b778b0aa53bcca6655a253d6be32e6e32c81 | |
parent | cd8040b0d40a2c262a0491a498714f32663377b4 (diff) |
update examples for guilescript 0.2.0
-rw-r--r-- | examples/choices.gs | 7 | ||||
-rw-r--r-- | examples/spotify.gs | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/examples/choices.gs b/examples/choices.gs index f1f2773..a5ef5c8 100644 --- a/examples/choices.gs +++ b/examples/choices.gs @@ -2,7 +2,8 @@ (define choices #("Bread" "Pudding" "Cake")) -(define app (Application.currentApplication)) -(set! app.includeStandardAdditions #t) +(define app (js-invoke Application currentApplication)) -(.chooseFromList app choices) +(js-set! app includeStandardAdditions #t) + +(js-invoke app chooseFromList choices) diff --git a/examples/spotify.gs b/examples/spotify.gs index 9f8ff93..ad1d03d 100644 --- a/examples/spotify.gs +++ b/examples/spotify.gs @@ -2,6 +2,10 @@ (define spotify (Application "Spotify")) -(.playpause spotify) +(js-invoke spotify playpause) -(log:info (.name (.currentTrack spotify)) "by" (.artist (.currentTrack spotify))) +(define currentTrack (js-invoke spotify currentTrack)) +(define name (js-invoke currentTrack name)) +(define artist (js-invoke currentTrack artist)) + +(console-log name "by" artist) |