Wenn-dann-Anweisung mit Applescript im Mac-Terminal?

Wenn-dann-Anweisung mit Applescript im Mac-Terminal?

Wie lautet der Code für:

„Wenn $foo eins ist, dann sollte $foo jetzt 18 ergeben“?

Danke

Antwort1

In Bash (Befehlszeile):

if [ "$foo" = "1" ] ; then
  foo=18
fi

in AppleScript:

if foo equals 1 then
    set foo to 18
end if

Antwort auf die Kommentare:

set foo to 5
tell application "System Events"
    tell application "Firefox" to activate
    keystroke (foo as text) using command down
end tell

Sie können dies wahrscheinlich unverändert an meine Antwort auf Ihre vorherige Frage anhängen, abzüglich der set fooZeile.

verwandte Informationen