я не сделал приложение AppleScript на Xcode от возраста,Xcode: Applescript приложение
вот мой код
script AppDelegate
property parent : class "NSObject"
-- IBOutlets
property theWindow : missing value
property myTextField : missing value
on applicationWillFinishLaunching_(aNotification)
-- Insert code here to initialize your application before any files are opened
end applicationWillFinishLaunching_
on applicationShouldTerminate_(sender)
-- Insert code here to do any housekeeping before your application quits
return current application's NSTerminateNow
end applicationShouldTerminate_
on myButton_(sender)
-- AppleScript
end myButton_
on saveNote_(sender)
-- AppleScript
end saveNote_
end script
, но у меня есть эта ошибка:
/AppDelegate.applescript: 32: ошибка: ожидаемый «конец», но найден неизвестный токен. (-2741) Не удалось выполнить команду/usr/bin/osacompile с кодом выхода 1
Вы можете мне помочь?
PS здесь является AppleScript
to getInputByClass2(theClass, num)
tell application "Safari"
set input to do JavaScript "
document.getElementsByClassName('" & theClass & "')[" & num & "].innerHTML;" in document 1
end tell
return input
end getInputByClass2
getInputByClass2("field type-string field-DATAID", 0)
set theText to Unicode text
set theSource to getInputByClass2("field type-string field-DATAID", 0)
property leftEdge : "class=\"value\">"
property rightEdge : "</span>"
set saveTID to text item delimiters
set text item delimiters to leftEdge
set classValue to text item 2 of theSource
set text item delimiters to rightEdge
set theDATAID to text item 1 of classValue
set text item delimiters to saveTID
theDATAID
вот результат на Xcode
Так что, кажется, исходят из: на saveNote_ (отправитель) - AppleScript конец saveNote_ –