Hi,
Man kann ja iTunes auf entfernten Mac OS X Rechnern steuern:
Nun würde ich gerne überprüfen,Code:tell application "iTunes" of machine "eppc://192.168.1.200" to next track
Meine ersten Ansätze:Code:ob das entfernte iTunes läuft dann das entfernte iTunes steuern wenn nein dann das lokale iTunes steuern.
Allerdings funktioniert das nicht, weil wenn hinter "of machine" eine Variable und kein String-Literal folgt, denkt er dass playpause eine Variable wäreCode:on getHost() tell application "System Events" of machine "eppc://192.168.1.200" to set isRunning to (name of processes) contains "iTunes" if isRunning then return "eppc://192.168.1.200" else return "eppc://192.168.1.201" end if end getHost try set theHost to getHost() tell application "iTunes" of machine theHost to playpause end try![]()
Komme mit Applescript nicht wirklich klar. Es ist einfach nicht logisch.
Code:#funktioniert: tell application "iTunes" of machine "eppc://192.168.1.200" to playpause #funktioniert nicht! set theHost to "eppc://192.168.1.200" tell application "iTunes" of machine theHost to playpause
Und dann ist auch noch die Undo-Funktion vom Scripteditor verbuggt... alter schwede
Danke![]()
+ Antworten
Ergebnis 1 bis 4 von 4
-
04.11.2008, 00:42 #1Granny Smith
Themenstarter
- Registriert
- 06.2007
- Beiträge
- 14
[AppleScript] Prüfen, ob iTunes auf entfernter Maschine läuft
-
04.11.2008, 01:21 #2
Hallo Kampfgnom!

Hihi! Manchmal kann man wirklich verzweifeln. Kopf hoch!
Mir ist übrigens noch gar nicht aufgefallen, daß die Undo Funktion buggy ist.Code:set theHost to "eppc://192.168.1.200" using terms from application "iTunes" tell application "iTunes" of machine theHost to playpause end using terms from
Was stimmt denn da nicht?
Sedna
-
04.11.2008, 13:23 #3Granny Smith
Themenstarter
- Registriert
- 06.2007
- Beiträge
- 14
EDIT: Siehe unten...
################################################
Ich verstehe zwar nicht was dieses Konstrukt soll, will es aber auch lieber nicht wissen. Hinterher mag ich noch Apple-Script *schauder*
Auf jeden Fall danke, es funktioniert nun:
Etwas umständlich, aber hey es läuft...Code:on checkProcess() tell application "System Events" of machine "eppc://192.168.1.200" set isRunning to ((application processes whose (name is equal to "iTunes")) count) end tell if isRunning is greater than 0 then return true else return false end if end checkProcess on getHost() if checkProcess() then return "eppc://192.168.1.200" else return "eppc://192.168.1.201" end if end getHost set theHost to getHost() using terms from application "iTunes" tell application "iTunes" of machine theHost to playpause end using terms from
Was verbuggt ist an der Undo-Funktion:
Nachdem ich ein paar mal Apfel-Z gedrückt habe kommt das hier dabei raus:
Manchmal passiert auch einfach nichts, was meistens besser ist, weil Redo funktioniert bei mir auch nicht. Hab schon lange nicht mehr neugestartet und auch den Scripteditor seit ein paar Tagen am laufen. Kann also nicht sagen, ob das ganze reproduzierbar ist.Code:on checkProcess() tell application "System Evenachine "eppc://192.168.1.200" set isRunning to ((application processes whose (name is equal to "iTunes")) count) end tell if isRunning is greater than 0 then return tru//192.168.1.200"e else return f//192.168.1.201"alse end if end checkProcess on getHost() if ceppc://192.168.1.201" end if end g from application "iTunes" tell application "iTuneachine theHost to playpause end using terms from
Danke nochmal
################################################
EDIT:
Hm Applescript scheint nicht deterministisch zu sein. Das Script funktioniert eine zeitlang (5 Minuten). Jetzt sagt er mir:
Was mach ich denn nun?System Events got an error: Cannot find process on host
-
04.11.2008, 16:01 #4Granny Smith
Themenstarter
- Registriert
- 06.2007
- Beiträge
- 14
Ich Doppelposte mal um die Übersicht zu erhalten. Es funktioniert nun endgültig (meine Änderungen in Rot):
Warum funktioniert das jetzt und vorher nicht? Semantisch ist es genau das gleicheCode:set myHost to "eppc://192.168.1.200" on checkProcess() try tell application "System Events" of machine myHost set isRunning to ((application processes whose (name is equal to "iTunes")) count) end tell if isRunning is greater than 0 then return true else return false end if on error return false end try end checkProcess on getHost() if checkProcess() then return "eppc://192.168.1.200" else return "eppc://192.168.1.201" end if end getHost set theHost to getHost() using terms from application "iTunes" tell application "iTunes" of machine theHost to playpause end using terms from
Ähnliche Themen
-
Kein entfernter Zugriff über Front Row möglich
Von luettmatten im Forum OS XAntworten: 19Letzter Beitrag: 24.08.2007, 11:42 -
itunes und last.fm mit applescript koppeln?
Von trust_us_24 im Forum AppleScriptAntworten: 19Letzter Beitrag: 23.01.2007, 14:28 -
svn Repository+entfernter Server commiten
Von cellardoor im Forum Web-ProgrammierungAntworten: 11Letzter Beitrag: 07.01.2007, 18:11 -
Problem mit Applescript und iTunes
Von Medico im Forum OS XAntworten: 0Letzter Beitrag: 15.12.2006, 10:54 -
Brauche AppleScript für iTunes
Von Stalefish im Forum AppleScriptAntworten: 12Letzter Beitrag: 08.12.2006, 13:13



Zitieren
