AppleScript: Word count 2
Hi,
Marked my previous Q AppleScript: word count as solved before testing it. the answer that was given compiled correctly but didn't run. Instead produced error "Google Chrome got an error: Can’t make 2 into type specifier."
if (countwords of wordStr) is greater than 2 then
set vol to word 2 of textNeeded
tell application "Numbers" to activate
tell application "System Events"
tell process "Numbers"
keystroke "["
keystrokevol
keystroke "]"
keystroke " "
end tell
end tell
end if
So I played around with the script. trying:
if (countwords of wordStr) is greater than (count 2) then
if (countwords of wordStr) is greater than (count word 2) then
if (countwords of wordStr) is greater than (count of 2) then
with and without brackets.
and mostly got the same error. one variation produced the error "Google Chrome got an error: Can’t get word 2.".
What am I doing wrong? If it helps I can paste the whole script otherwise let's hope it can be solved.
Thanks
MacBook Pro with Retina display, macOS High Sierra (10.13.4)