私は次のことをしようとしています:
on cleanup(x)
tell application "Finder"
clean up window 1 by x
end tell
end cleanup
cleanup("name")
ただし、x 変数は文字列であるため、クリーンアップ コマンドはそれを受け入れず、エラーで終了します。文字列をコマンドが受け入れるものに変換する方法、またはifを使用せずに変数の引用符を外す他の解決策はありますか, 次のようなステートメント:
on cleanup(x)
tell application "Finder"
if x is "name" then
clean up window 1 by name
end if
end tell
end cleanup
cleanup("name")