Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
Autor |
Nachricht |
Cembalo •->

Anmeldedatum: 27.03.2008 Beiträge: 2 Wohnort: Erfurt
|
Verfasst am: 06.05.2008 - 22:09 Titel: Bedingung mit mehreren Möglichkeiten ( if_"a"or&am |
|
|
Korrektur: (if_"a" or "b"_then) .. sollte es im Titel heißen.
Hallo liebe Scripter,
Was ist falsch ?
1.) geht einwandfrei.
2.) geht nur erstes Zeichen
3.) wie unter 2.)
text display dialog default answer ""
set DlogResult to result
1. ) if text returned of result = "#" then
tell application "Finder"
activate
open document file "a1" of folder "b1" of folder "c1" of folder "Applications" of startup disk
end tell
2. ) else if text returned of result = "q" or "w" or "e" or "p" then
tell application "Finder"
activate
open document file "a2" of folder "b2" of folder "c2" of folder "Applications" of startup disk
end tell
3. ) else if text returned of result = {"a","b","c","d"}then
tell application "Finder"
activate
open document file "a3" of folder "b3" of folder "c3" of folder "Applications" of startup disk
end tell
end if
Ich fand kein Beispiel im Forum. Geht das überhaupt ?
Gruß cembalo |
|
Nach oben |
|
 |
Skeeve •---->


Anmeldedatum: 20.04.2006 Beiträge: 1067
|
Verfasst am: 07.05.2008 - 08:39 Titel: Re: Bedingung mit mehreren Möglichkeiten ( if_"a"o |
|
|
Entweder:
Code: | if text returned of the result is "a" or text returned of the result is "b" then |
oder
Code: | if text returned of the result is in {"a", "b" } then
|
oder
Code: | if offset of (text returned of the result) in "ab" > 0 then
|
_________________ "All problems are solved in slightly less than half an hour" (Chumbawamba, "Hey Hey We're The Junkies") |
|
Nach oben |
|
 |
Cembalo •->

Anmeldedatum: 27.03.2008 Beiträge: 2 Wohnort: Erfurt
|
Verfasst am: 07.05.2008 - 23:28 Titel: |
|
|
Hallo Skeeve,
ganz herzlichen Dank für die schnelle Antwort.
Deine Version 2 ist mir die feinere Art und funktionierte sofort.
"ist gleich" (=) oder "is in": Das ist der feine Unterschied!!
Das ist wie mit den Bayern und den Sachsen: Beide meinen das Gleiche, aber sie verstehen sich nicht. :-)
Gruß Cembalo |
|
Nach oben |
|
 |
|