AppleScript Dialog im Finder aus Shell-Script heraus anzeigen

Ab und an ist es hilfreich, wenn ein Shell-Script auch mal Laut gibt. das geht auf dem Mac recht leicht, über einen Apple-Script-Auftruf.Das Beispiel hier soll so etwas vereinfacht darstellen,Eine Bash-Variable wird gesetzt und anschließend im Finder in einer Dialog-Box angezeigt.
hubis-computer:~ hubi$ hubi="Hallo, jetzt koennen ich Bash-Scripte mit Finder-Dialgen nerven =)"
hubis-computer:~ hubi$ osascript -e "tell application \"Finder\" to activate" -e "tell application \"Finder\" to display dialog \"$hubi\""
button returned:OK
Und ja, man kann so sogar über einen AppleScript-Dialog Parameter über ein DIalog-Feld an das Bash-Script zurück geben (in diesem Fall button returned:OK) .Alles aus einem Bash-Script heraus =)
This entry was posted in AppleScript, OS X and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA:


eight × 7 =

Subscribe without commenting

  • Seite übersetzen:


    Paypal for Pizza:




  • Kategorien


  • Letzte Kommentare

    • Niklas: Vielen Vielen Dank! So klappt es!
    • hubi: Servus Niklas, ich habe mir den Quellcode noch einmal angesehen und habe nun unter 10.7.3 einen Weg gefunden...
    • Niklas: Klingt super das Script. Leider bekomm ich immer folgende Fehlermeldung: error “„Mail“ hat einen Fehler...
    • Jürgen: Hallo Hubi, beim Abfragen von Kennworten gibt es noch eine böse Falle: Das Format, in dem security antwortet,...
    • hubi: Am einfachsten Du öffnest im AppleScript-Editor mal das Funktionsverzeichnis (unter Ablage) von iTunes. Ein...