Я недавно установил Warcraft3: TFT на мой Mac, используя Wine, потому что версия Mac не поддерживает Lion.Я написал скрипт, используя Applescript, чтобы запустить терминальную команду для Wine, а затем отключил мои горячие углы, чтобы у меня не возникало проблем с перемещением по экрану.
Я написал скрипт, и он нормально работает через Applescript (Compile> Беги).Настоящая проблема возникает при попытке сохранить скрипт как приложение.Я сохраняю его как приложение, а затем пытаюсь запустить приложение (названное «Warcraft III - The Frozen Throne») и получаю эту ошибку:
![error message on script app execution](https://i.stack.imgur.com/XOHP2.png)
Вот сам скрипт:
set settings1 to {"-", "Desktop", "Start Screen Saver", "Mission Control"}
set settings2 to {"-", "-", "-", "-"}
tell application "Terminal"
do script "/opt/local/bin/wine ~/.wine/drive_c/Program\\ Files/Warcraft\\ III/war3.exe"
end tell
tell application "System Preferences"
reveal pane id "com.apple.preference.expose"
activate
tell application "System Events"
tell window "Mission Control" of process "System Preferences"
click button "Hot Corners…"
tell sheet 1
tell group 1
set theSettings to settings2
set functionKeys to false
repeat with k from 1 to 4
set theValue to item k of theSettings
tell pop up button k
if value is not theValue then
click
click menu item theValue of menu 1
end if
end tell
end repeat
end tell
click button "OK"
end tell
end tell
end tell
quit
end tell
display alert "Done playing?" buttons {"Yes"}
set response to button returned of the result
if response is "Yes" then
--Start return to normal settings
tell application "System Preferences"
reveal pane id "com.apple.preference.expose"
activate
tell application "System Events"
tell window "Mission Control" of process "System Preferences"
click button "Hot Corners…"
tell sheet 1
tell group 1
set theSettings to settings1
set functionKeys to true
repeat with k from 1 to 4
set theValue to item k of theSettings
tell pop up button k
if value is not theValue then
click
click menu item theValue of menu 1
end if
end tell
end repeat
end tell
click button "OK"
end tell
end tell
end tell
quit
end tell
--End return to normal settings
--quit X11 and terminal
tell application "X11"
quit
end tell
tell application "Terminal"
quit
end tell
end if
Это первый раз, когда я действительно написал в Applescript, так что, возможно, в нем есть какая-то ошибка, которую я не вижу.Заранее спасибо за любой совет или вклад!