У меня есть строка в моем appleScript, которая не будет читать переменную, установленную для имени приложения
set ReadAppVersion to value of version of application TheApp
но если я использую это ниже, это работает.
set ReadAppVersion to value of version of application "OsiriX"
По какой-то причине я не могу прочитать версию приложения, если она у меня есть в качестве имени переменной.
Но если я воспользуюсь этим ниже, это сработает.
set ReadAppVersion to value of version of application "OsiriX"
on AppOsirixChecks(TheApp)
delay 1
tell application "Finder"
close every window
end tell
do shell script "defaults write com.apple.finder AppleShowAllFiles FALSE"
tell application "Dock"
tell application "System Events"
tell process "Dock"
click UI element "Finder" of list 1
end tell
end tell
end tell
menu_click({"Finder", "Go", "Applications"})
delay 1
set ReadAppName to 0
set ReadAppVersion to 0
set TheRow to 2
tell application "System Events"
tell process "Finder"
repeat until ReadAppName is equal to TheApp
set ReadAppVersion to value of version of application "osirix"
set ReadAppName to value of text field 1 of UI element 1 of row TheRow of outline 1 of scroll area 1 of splitter group 1 of splitter group 1 of window "Applications"
set TheRow to TheRow + 1
if ReadAppVersion doesn't equal AppVersionOsiriX then
log "TEST FAILURE !: The current version is: " & ReadAppVersion
end if
end repeat
end tell
end tell
log ">>> Current Application Name is: " & ReadAppName
log ">>> Current Application version is: " & ReadAppVersion
--return TheRow -- this line does not seem necessary
tell application "Finder"
activate
delay 2
close every window
do shell script "defaults write com.apple.finder AppleShowAllFiles TRUE"
end tell
end AppOsirixChecks
<filepath>/upgrade_test_validation_checklist.scpt:10612:10617: execution error: OsiriX got an error: Can’t make «class valL» of version into type specifier. (-1700)