script AppDelegate
propertyparent : class"NSObject"
@private
NSWindow *window
myTextView's setString_(finalstring)
property myTextView : missing value set tickerArray to {"GOOG"}
set missing value to finalString
set finalString to ""
repeat with theTicker in tickerArray
set impNumbers to (do shell script"curl \"http://www.google.com/finance?client=ob&q=" & theTicker & "\" | sed 's/<[^>]*>//g' | grep -A12 \"google.finance.renderRelativePerformance();\"")
if character 1 of paragraph 12 of impNumbers = "+" then
set posNeg to true
else if character 1 of paragraph 12 of impNumbers = "-" then
set posNeg to false
end if
set finalString to finalString & (theTicker as string)
if (number of characters of theTicker) < 3 then
set spacer to" "
else
set spacer to" "
end if
set finalString to finalString & spacer & (paragraph 9 of impNumbers)
set finalString to finalString & " " & (character 1 of paragraph 12 of impNumbers) & ((characters 2 through (number of characters of paragraph 12 of impNumbers) of paragraph 12 of impNumbers) as string)
if (character 2 of paragraph 13 of impNumbers) as string = "-" then
set finalString to finalString & " " & (paragraph 13 of impNumbers) & return
else
set finalString to finalString & " (" & (character 1 of paragraph 12 of impNumbers) & (characters 2 through -1 of paragraph 13 of impNumbers) & return
end if
endrepeat
end
end myTextView
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_
endscript
--------------------------------
This is what I got.
I linked it to a NSTextField in a Cocoa applescript application but it returns on error.
Called: OSACompile Error
OSACompile "Text Test/AppDelegate.applescript"
cd "/Users/Victor/Documents/Xcode Projects/Text Test"
/usr/bin/osacompile -l AppleScript -d -o "/Users/Victor/Library/Developer/Xcode/DerivedData/Text_Test-gcjfkcupycpcwtauqv lttrqnyeme/Build/Products/Debug/Text Test.app/Contents/Resources/AppDelegate.scpt" "Text Test/AppDelegate.applescript"
Text Test/AppDelegate.applescript:12: error: Expected end of line, etc. but found unknown token. (-2741)
Command /usr/bin/osacompile failed with exit code 1
What does this mean?????đźđźđź
Please help me