Kaito
Aktives Mitglied
Thread Starter
- Dabei seit
- 31.12.2005
- Beiträge
- 7.093
- Reaktionspunkte
- 1.844
Von http://stackoverflow.com/questions/...hing-is-a-directory-or-a-file/6881524#6881524 habe ich mir folgendes abgeschaut:
Ich frage mich wozu ist die erste Zeile gut? Ich erkenne im Verhalten keinen Unterschied ob mit oder ohne.
Eine andere Frage wären noch je die beiden Zeilen mit den dir_path Variablen. Das kann ich nicht in eine schreiben,
set qdir_path to quoted form of (POSIX path of (container of (contents of anItem) as string))
resultiert in "cant make quoted form of posix path of alias", was mir nicht ganz sinnvoll erscheint, wenn es auf zwei Zeilen aufgeteilt doch funktioniert.
Code:
on run {input, parameters}
--tell application "Finder" to set input to (selection) as alias list
tell application "System Events"
repeat with anItem in input
if anItem is package folder or kind of anItem is "Folder" or kind of anItem is "Volume" then
set dir_path to (POSIX path of (contents of anItem))
set qdir_path to quoted form of dir_path
my CD(qdir_path)
else
set dir_path to (POSIX path of (container of (contents of anItem) as string))
set qdir_path to quoted form of dir_path
my CD(qdir_path)
end if
delay 0.1
end repeat
end tell
end run
Eine andere Frage wären noch je die beiden Zeilen mit den dir_path Variablen. Das kann ich nicht in eine schreiben,
set qdir_path to quoted form of (POSIX path of (container of (contents of anItem) as string))
resultiert in "cant make quoted form of posix path of alias", was mir nicht ganz sinnvoll erscheint, wenn es auf zwei Zeilen aufgeteilt doch funktioniert.