все, я пытаюсь заставить пользователя ввести имя mov ie, для которого они хотят субтитры, и сценарий для apple, чтобы автоматически искать на сайте субтитров имя mov ie, которое они ввели. Для этого необходимо заменить все пробелы в имени mov ie на знак +, поскольку URL-адреса преобразуют пробелы в знак +. Код не работает, и я получаю следующие ошибки:
- Ожидается «конец», но найдено «on».
- A «(» не может go после этого идентификатора .
Вот мой код;
on run
display dialog "What's the name of the movie?" default answer " " with title "What's the name of the movie?" buttons {"OK"} default button 1
set moviename to text returned of the result
set theText to moviename
set theSearchString to " "
set theReplacmentString to "+"
end findAndReplaceInText(theText, theSearchString, theReplacementString)
set AppleScript's text item delimiters to theSearchString
set theTextItems to every text item of theText
set AppleScript's text item delimiters to theReplacementString
set theText to theTextItems as string
set AppleScript's text item delimiters to ""
return theText
end findAndReplaceInText
goToWebPage("https://rs.titlovi.com/prevodi/?prevod= & thetext")
tell application "Safari"
activate
set URL of document 1 to theWebPage
end tell
end goToWebPage
end run
Заранее спасибо.