Accessing files in iCloud Drive

A forum for issues on macOS; the UNIX and Linux forums may have relevent posts

Accessing files in iCloud Drive

Postby mikepowell on Wed Sep 07, 2022 2:31 pm

I have a file that I'd like to keep in iCloud Drive so that I can access it from APL either on my Mac or on on my laptop.

According to Apple's documentation, the first step is to give Dyalog APL (a third party app) permission to access iCloud Drive. You do this on the System Preferences panel going to Apple Id, selecting iCloud Drive, then using Options to select your third party app from a list. Unfortunately Dyalog APL does not appear there, although several other third party apps do (eg MacFamilyTree, Affinity Designer, Pixelmator etc).

Is there something that Dyalog APL needs to do (presumably at install time) to register as one of these third party apps?

Mike Powell
mikepowell
 
Posts: 6
Joined: Thu Dec 05, 2013 8:01 pm

Re: Accessing files in iCloud Drive

Postby kennedyce on Fri Nov 25, 2022 7:12 pm

This may not be what you are looking for, but here is a method that (sort of) works for me.
I have a file on my iCloud Drive named, say, a_cloud.csv. In the APL session, I use ⎕CSV to fetch the file into an APL variable, say, a_local:
)clear
clear ws
a_local←⎕csv '/Users/CEK1/Library/Mobile Documents/com~apple~CloudDocs/a_cloud.csv'
⍴a_local
161 1

However, it doesn't work if you don't specify the full path name for some reason:
⎕CMD 'pwd'
/Users/CEK1
b_local←⎕csv '~/Library/Mobile Documents/com~apple~CloudDocs/a_cloud.csv'
FILE NAME ERROR: ~/Library/Mobile Documents/com~apple~CloudDocs/a_cloud.csv: Unable to open file ("No such file or directory")
b_local←⎕CSV'~/Library/Mobile Documents/com~apple~CloudDocs/a_cloud.csv'


I haven't had any luck with ⎕NGET, but that's probably my unfamiliarity with ⎕NGET.
If your laptop is a PC, I don't know the Windows file spec for the iCloud Drive.
kennedyce
 
Posts: 6
Joined: Thu Aug 15, 2013 7:27 pm

Re: Accessing files in iCloud Drive

Postby kennedyce on Fri Nov 25, 2022 10:23 pm

Here's another way to fetch data from an iCloud Drive:
)CLEAR
clear ws
)copy loaddata
/Applications/Dyalog-18.2.app/Contents/Resources/Dyalog/ws/loaddata.dws saved Wed Apr 6 16:21:17 2022
c←LoadTEXT '/Users/CEK1/Library/Mobile Documents/com~apple~CloudDocs/a_cloud.csv'
⍴c
162 1
kennedyce
 
Posts: 6
Joined: Thu Aug 15, 2013 7:27 pm

Re: Accessing files in iCloud Drive

Postby Vince|Dyalog on Mon Nov 28, 2022 9:29 am

Hi Kennedyce,

The reason why your example which uses ~ does not work is that Dyalog does not expand ~ like UNIX shells do.

We have thought about it, but we have not come up with a cross-platform design that we are happy with.

Regards,

Vince
Vince|Dyalog
 
Posts: 432
Joined: Wed Oct 01, 2008 9:39 am

Re: Accessing files in iCloud Drive

Postby mikepowell on Wed Dec 21, 2022 11:23 pm

Thanks for the replies. This was just what I needed to find where I was going wrong.

I think I was misspelling the iCloud folder name. I was using ".../com-apple-CloudDocs/..." when I should have been using ".../com~apple~CloudDocs/...". Now I have it working nicely.

Thanks again,

Mike
mikepowell
 
Posts: 6
Joined: Thu Dec 05, 2013 8:01 pm


Return to macOS

Who is online

Users browsing this forum: No registered users and 0 guests