Automations with iCloud Drive that involve using the path name - worth it or not?

Does anyone here use iCloud Drive in conjunction with automations that require using the path name, e.g. using the terminal or other scripting languages? As far as I can tell:

  • The default path to iCloud Drive uses the hidden Library directory in Finder, and is just ugly.
  • There is no way of changing the default location of the iCloud Drive directory, like you can with Dropbox.
  • The files that appear in iCloud Drive accessed using the full path name may not be consistent with iCloud Drive on iOS devices.

Is it fair to say that if you need the full path name, you should just use Dropbox or Google Drive or another cloud storage service that allows you to stick the cloud folder wherever you want?

No. Sometimes iCloud is the only available option.

The ‘beauty’ of the file path in my opinion isn’t a consideration. Automation around that should be a set it and forget it affair.

You may not be able to change a location, but you are using a *nix based OS. On a Mac, you can create symbolic links to make folders appear mounted wherever you need them in the file structure.

Regarding file inconsistency between iOS and other platforms (I have iCloud Drive on MacOS and Win10 for example), I’ve not noted any myself yet for the things I do. Given they are supposed to be synchronised copies I’d not expect inconsistency; not to say there isn’t though. Do you have any specific examples of this that you can share?

1 Like

I’ve had no issues using AppleScript with files and and folders in iCloud drive. The path names are long, but if you assign them to a variable, they won’ clutter your script. For example here is how I set the path to a Numbers spreadsheet stored in the iCloud Drive Numbers folder; this document is assigned to the variable numbersDoc.

set numbersDoc to ((path to library folder from user domain as text) & ¬
	"Mobile Documents:com~apple~Numbers:Documents:spreadsheet.numbers") as alias