In AppleScript Editor i can see that source_code has script content but row 2 fails for some reason.
set source_code to load script (POSIX file "/path/to/script.scpt")
word 2 of source_code
This don't work. I try to read AppleScript files to variable.
I don't try to run this loaded code but i need to get it as string.
It seems to fail because source_code is «script» not string. How this can be fixed? Thanks
set source_code to load script (POSIX file "/path/to/script.scpt")
word 2 of (source_code as string) -->error "Can’t make «script» into type string." number -1700 from «script» to string
word 2 of source_code -->error "Can’t get word 2." number -1728 from word 2
set source_code ...
) but the second doesn't? What do you expect the second line to do exactly? – patrix♦ Apr 22 at 15:03