forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpower-on.applescript
executable file
·35 lines (29 loc) · 983 Bytes
/
power-on.applescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/osascript
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Power On
# @raycast.mode compact
# Optional parameters:
# @raycast.icon images/denon_logo.png
# @raycast.packageName Denon AVR
# Documentation:
# @raycast.description Powers on a modern Denon AVR if it is currently powered off
# @raycast.author Rediwed
# @raycast.authorURL github.com/Rediwed
on run
set ip_address to (do shell script "defaults read com.Rediwed.DenonAVR ip_address")
if (do shell script "defaults read com.Rediwed.DenonAVR method") = "modern" then
runModern(ip_address)
else
runClassic(ip_address)
end if
end run
on runModern(ip_address)
do shell script "curl " & ip_address & ":8080/goform/formiPhoneAppDirect.xml?PWON"
log "Powering on..."
end runModern
on runClassic(ip_address)
#classic is not yet set-up
#do shell script "curl 192.168.0.214:8080//goform/formiPhoneAppDirect.xml?MV" & (item 1 of argv)
log "Classic has not yet been set-up"
end runClassic