Example using getResourceValue:forKey:error

Here is example of using isUbiquitousItemAtURL & getResourceValue method to get uploadKey
from NSURLUbiquitousItemIsUploadedKey.

It will ask for a folder (you need to point that folder to iCloud) return boolean
You could test by remove internet connection and update a file (iCloud folder) and run
the script and it will return false. Connect to internet and run the script again and it will
return true.

use framework "Foundation"
use scripting additions

set thePath to POSIX path of (choose file)
set theURL to current application's |NSURL|'s fileURLWithPath:thePath
set filemanager to current application's NSFileManager's defaultManager()

if filemanager's isUbiquitousItemAtURL:theURL then
	set {theResult, theUploadKey, theError} to (theURL's getResourceValue:(reference) forKey:(current application's NSURLUbiquitousItemIsUploadedKey) |error|:(reference))
	return theUploadKey as boolean
end if