In my attempt to AppleScript a path to a file on a shared Google Drive, I noticed that the path assigned to the file by Google Drive, can vary between users.
On my Mac , the path
/Volumes/GoogleDrive/
permits retrieval of files from the shared Google Drive. On other users’ Macs, where Google Drive is not mounted in the Volumes directory, access to the shared Google drive file requires a path through Cloud Storage, beginning with
/Users/USERNAME/Library/CloudStorage/GoogleDrive-USEReMAIL
Attempting to evaluate Google Drive’s preferences on my Mac, with read defaults
do shell script "defaults read ~/Library/Preferences/com.google.drivefs.settings"
yielded
{
DoNotShowNotifications = “{\“entry\”:[{\“notification_type\”:174},{\“notification_type\”:234},{\“notification_type\”:190},{\“notification_type\”:170},{\“notification_type\”:201}]}”;
PerAccountPreferences = “{\“per_account_preferences\”:[{\“key\”:\“GOOGLEDRIVEkeyA\”,\“value\”:{\“mount_point_path\”:\”/Volumes/GoogleDrive\“,\“mac_smb_port\”:55319,\“enable_smb_spotlight\”:true}},{\“key\”:\“GOOGLEDRIVEkeyB\”,\“value\”:{\“mount_point_path\”:\”/Users/USERNAME/Library/CloudStorage/GoogleDrive-GoogleDrive-USEReMAIL\“}}]}”;
SearchHotKey = SEARCHHOTKey;
}
It appears to me that Google Drive maintains various account mount points, one through the Volumes directory and the other via Library’s Cloud Storage. Although the Google Drive preferences on my Mac contain these two mount points, other users preferences’ mount points only contain a Cloud Storage path.
My goal is to write an AppleScript that can locate the path to a file on this shared Google Drive, regardless of the user’s email address, so that AppleScript will locate a file on any Mac that has access to this shared Google Drive.