Как открыть случайный файл из указанной папки с помощью AppleScript?

234
yughred

Вот код, который я сейчас имею:

tell application "Finder" get some file of (folder (POSIX file "Desktop/musics")) end tell 
1

2 ответа на вопрос

0
CJK
tell application "Finder" to open some file in the folder ¬ (POSIX file "/Users/%you%/Desktop/musics") 

где %you%должно быть заменено именем вашего домашнего каталога пользователя (он похож на дом в Finder ).

0
wch1zpink

Вот еще один вариант.

tell application "Finder" set someFile to some file of folder ((path to desktop as text) & "musics") open someFile end tell 

Похожие вопросы