• Das kreative Thema des Monats Oktober wird vor allem diejenigen unter Euch besonders ansprechen, denen Do-it-yourself quasi im Blut liegt. Zeigt uns Eure Improvisationskünste oder fotografiert, was andere Leute sich so im Alltag zusammengestrickt haben. --> Zum Mitmachen bitte hier klicken

Applescript hängt...

Turkey1976

Raisin Rouge
Registriert
03.07.07
Beiträge
1.174
Hallo Mädls, hallo Jungs,

dieser Teil meines Scripts macht mir Sorgen:

Code:
    try
        ignoring application responses
            with timeout of 15 seconds
                do shell script "/Applications/lastfmproxy/main.py > /dev/null &"
            end timeout
        end ignoring
    end try
Es soll mit "do shell script" das Pythonscript "main.py" gestartet werden. Das funktioniert auch. Nun ist das Pythonscript aBer endlos und so BleiBt das Applescript Beim Aufruf einfach hängen, und zwar so lange Bis ich den task kille! Ich haBe schon versucht mit & den Task von der Shell zu lösen, aBer das Bringt hier leider nichts.

Was kann ich tun, damit das Script nach dem Start des Pythonscripts weiterarBeitet?

Turkey


---
PS: das kleine B funktioniert im Moment nicht
 
Q: I want to start a background server process; how do I make do shell script not wait until the command completes?

A: Use do shell script "command &> file_path &". do shell script will return immediately with no result and your AppleScript script will be running in parallel with your shell script. The shell script’s output will go into file_path; if you don’t care about the output, use /dev/null. There is no direct support for getting or manipulating the background process from AppleScript, but see the next question.
von
http://developer.apple.com/technotes/tn2002/tn2065.html
 
Danke für den Tip!

Wenn ich die Zeile abändere, also ein weiteres "&" hinzufüge ändert sich nichts:
Code:
  do shell script "/Applications/lastfmproxy/main.py & > /dev/null &"

Immer noch arbeitet das Script nach dem Aufruf nicht weiter...