[
  {
    "path": ".gitignore",
    "content": "#\n# Ignore\n#\n\n*.swp\n.DS_Store\n"
  },
  {
    "path": "LICENSE.md",
    "content": "The MIT License (MIT)\n\n&#169; 2024 Nicolò Diamante <hello@nicolodiamante.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/8c37ca97-ebd7-41dd-9ce2-f362c8fedb5a\" draggable=\"false\" ondragstart=\"return false;\" alt=\"iCloud NoSync\" title=\"iCloud NoSync\" />\n    <img src=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/7252ce73-8f3b-4d70-8168-066b610148ae\" draggable=\"false\" ondragstart=\"return false; \"alt=\"iCloud NoSync\" title=\"iCloud NoSync\" />\n  </picture>\n</p>\n\n[iCloud][apple-icloud] is a powerful utility that allows users to sync files across multiple devices. However, sometimes users may want to prevent certain files or folders from syncing. Apple has a blacklist of file names and extensions that users should avoid using in their iCloud Drive. Adding the extension .nosync to a file is a simple way to prevent iCloud from syncing that file. This technique is useful for selective syncing. However, adding the same extension to a folder will not prevent iCloud from syncing its contents. The only way to prevent an entire folder from syncing is to name it tmp or end it with .tmp.\n\n<br><br>\n\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/a1e57d3d-ec4d-485c-bfaa-54e4dc74e722\" draggable=\"false\" ondragstart=\"return false;\" alt=\"iCloud NoSync Finder\" title=\"iCloud NoSync Finder\" />\n    <img src=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/79be16a5-25f2-4ec4-a503-2ba359d9adf5\" draggable=\"false\" ondragstart=\"return false; \"alt=\"iCloud NoSync Finder\" title=\"iCloud NoSync Finder\" width=\"600px\" />\n  </picture>\n</p>\n\n<br><br>\n\n**iCloud No Sync:** hides and appends the appropriate extension to the file or folder, effectively stopping the sync process. It then creates a symbolic link with the same name as the original file or folder to avoid any issues with applications that depend on it.\n\n<br>\n\n**iCloud Sync:** it first unhides the original file or folder. Then, it removes the symbolic link and the extension to restart the synchronisation. This means that iCloud Sync always refers to the symlink to restart the sync, which ensures that the latest version of the file or folder is synchronised across all your devices. By removing the symbolic link and the extension, iCloud Sync ensures that the sync is done from scratch, which reduces the chances of any errors or conflicts during the synchronisation process.<br><br>\n\n## Getting Started\n\n### Installation\n\nThe installation process for this utility is designed for ease and convenience. You have two options:\n\n**Automatic Installation via `curl`**: Simply execute the following command in your terminal to quickly download and seamlessly install the utility:\n\n```shell\nzsh -c \"$(curl -fsSL https://raw.githubusercontent.com/nicolodiamante/icloud-nosync/HEAD/bootstrap.zsh)\"\n```\n\n**Manual Installation**: If you favor manual installation, first clone the repository to your local machine using `git`:\n\n```shell\ngit clone https://github.com/nicolodiamante/icloud-nosync.git\n```\n\nAfter cloning, navigate to the repository's directory in your terminal and execute the install script:\n\n```shell\nsource utils/install.zsh\n```\n\nThe script will copy the workflow files to `~/Library/Services` and then open the Privacy & Security panel.\n\n<br>\n\n### Show in Quick Action Menu\n\nOnce the script opens the Privacy & Security panel, select Finder and check the boxes:\n\n<br><br>\n\n<p align=\"center\">\n  <picture>\n    <img src=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/5a70657b-9fbf-40b2-b0f2-ade24e2c9b6c\" draggable=\"false\" ondragstart=\"return false;\" alt=\"Selected Quick Actions\" title=\"Selected Quick Actions\" width=\"600px\" />\n  </picture>\n</p>\n\n<br><br>\n\nAfter doing this, you should be able to right-click on files or folders in Finder and find the `iCloud No Sync` and `iCloud Sync` options in the Quick Action section of the context menu.\n\n<br>\n\n## How It Works\n\n1. Right-click on the file or folder you want to stop syncing to iCloud Drive.\n2. Select `iCloud No Sync` from the `Quick Actions` menu to stop the sync.\n3. Select `iCloud Sync` from the `Quick Actions` menu to sync it again.\n\n<br><br>\n\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/463b58e5-b7bc-4183-80d6-818b6464e23e\" draggable=\"false\" ondragstart=\"return false;\" alt=\"Quick Actions Menu\" title=\"Quick Actions Menu\" />\n    <img src=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/ebe5533b-43c7-406a-a8b5-c9f0a2411711\" draggable=\"false\" ondragstart=\"return false; \"alt=\"Quick Actions Menu\" title=\"Quick Actions Menu\" width=\"560px\" />\n  </picture>\n</p>\n\n<br>\n\n## Notes\n\n### Resources\n\n- [Apple Support][apple-guide]\n\n### Contribution\n\nAny suggestions or feedback you may have for improvement are welcome. If you encounter any issues or bugs, please report them to the [issues page][issues].\n<br><br>\n\n<p align=\"center\">\n  <picture>\n    <img src=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/82fd2d06-9e57-47fc-8f07-8d8b5a728a97\" draggable=\"false\" ondragstart=\"return false;\" /></>\n  </picture>\n</p>\n\n<p align=\"center\">\n  <a href=\"https://nicolodiamante.com\" target=\"_blank\">\n    <img src=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/aa3768d1-9434-4a15-9d01-1b0c984ccb0f\" draggable=\"false\" ondragstart=\"return false;\" alt=\"Nicol&#242; Diamante Portfolio\" title=\"Nicol&#242; Diamante\" width=\"17px\" />\n  </a>\n</p>\n\n<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/b407493d-679c-4b7a-b024-e07701700a14\" draggable=\"false\" ondragstart=\"return false;\" alt=\"MIT License\" title=\"MIT License\" />\n    <img src=\"https://github.com/nicolodiamante/icloud-nosync/assets/48920263/1c9f157c-7f5d-444f-8c73-dff70c191260\" draggable=\"false\" ondragstart=\"return false; \"alt=\"MIT License\" title=\"MIT License\" width=\"95px\" />\n  </picture>\n</p>\n\n<!-- Link labels: -->\n\n[apple-icloud]: https://www.apple.com/icloud/\n[apple-guide]: https://support.apple.com/guide/mac-help/get-file-folder-and-disk-information-on-mac-mchlp1774/11.0/mac/11.0\n[issues]: https://github.com/nicolodiamante/icloud-nosync/issues\n"
  },
  {
    "path": "bootstrap.zsh",
    "content": "#!/bin/zsh\n\n#\n# Start iCloud NoSync Installation.\n#\n\n# Validate OS.\nif [[ \"$OSTYPE\" != \"darwin\"* ]]; then\n  echo \"This script is only compatible with macOS\" >&2\n  exit 1\nfi\n\n# Defines the PATHs.\nSOURCE=\"https://github.com/nicolodiamante/icloud-nosync\"\nTARBALL=\"${SOURCE}/tarball/master\"\nTARGET=\"${HOME}/icloud-nosync\"\nTAR_CMD=\"tar -xzv -C \\\"${TARGET}\\\" --strip-components 1 --exclude .gitignore\"\nINSTALL=\"${TARGET}/utils/install.zsh\"\n\n# Check if a command is executable.\nis_executable() {\n  command -v \"$1\" &> /dev/null\n}\n\n# Checks which executable is available then downloads and installs.\nif is_executable \"git\"; then\n  CMD=\"git clone ${SOURCE} ${TARGET}\"\nelif is_executable \"curl\"; then\n  CMD=\"curl -L ${TARBALL} | ${TAR_CMD}\"\nelif is_executable \"wget\"; then\n  CMD=\"wget --no-check-certificate -O - ${TARBALL} | ${TAR_CMD}\"\nelse\n  echo 'No git, curl, or wget available. Aborting!'\n  exit 1\nfi\n\necho 'Installing iCloud NoSync...'\n\n# Create the target directory and proceed with the chosen download method.\nif ! mkdir -p \"${TARGET}\"; then\n  echo \"Error: Failed to create target directory. Aborting!\" >&2\n  exit 1\nfi\n\n# Execute the download command and run the installation script.\nif eval \"${CMD}\"; then\n  if cd \"${TARGET}\"; then\n    if ! source \"${INSTALL}\"; then\n      echo \"Error: Failed to run the install script. Aborting!\" >&2\n      exit 1\n    fi\n  else\n    echo \"Error: Failed to navigate to ${TARGET}. Aborting!\" >&2\n    exit 1\n  fi\nelse\n  echo \"Download failed. Aborting!\" >&2\n  exit 1\nfi\n"
  },
  {
    "path": "scripts/iCloud No Sync.workflow/Contents/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>NSServices</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>NSBackgroundColorName</key>\n\t\t\t<string>background</string>\n\t\t\t<key>NSIconName</key>\n\t\t\t<string>NSTouchBariCloud</string>\n\t\t\t<key>NSMenuItem</key>\n\t\t\t<dict>\n\t\t\t\t<key>default</key>\n\t\t\t\t<string>iCloud No Sync</string>\n\t\t\t</dict>\n\t\t\t<key>NSMessage</key>\n\t\t\t<string>runWorkflowAsService</string>\n\t\t\t<key>NSRequiredContext</key>\n\t\t\t<dict>\n\t\t\t\t<key>NSApplicationIdentifier</key>\n\t\t\t\t<string>com.apple.finder</string>\n\t\t\t</dict>\n\t\t\t<key>NSSendFileTypes</key>\n\t\t\t<array>\n\t\t\t\t<string>public.item</string>\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "scripts/iCloud No Sync.workflow/Contents/document.wflow",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>AMApplicationBuild</key>\n\t<string>509</string>\n\t<key>AMApplicationVersion</key>\n\t<string>2.10</string>\n\t<key>AMDocumentVersion</key>\n\t<string>2</string>\n\t<key>actions</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>action</key>\n\t\t\t<dict>\n\t\t\t\t<key>AMAccepts</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Container</key>\n\t\t\t\t\t<string>List</string>\n\t\t\t\t\t<key>Optional</key>\n\t\t\t\t\t<true/>\n\t\t\t\t\t<key>Types</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<string>com.apple.cocoa.string</string>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<key>AMActionVersion</key>\n\t\t\t\t<string>2.0.3</string>\n\t\t\t\t<key>AMApplication</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>Automator</string>\n\t\t\t\t</array>\n\t\t\t\t<key>AMParameterProperties</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>COMMAND_STRING</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t\t<key>CheckedForUserDefaultShell</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t\t<key>inputMethod</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t\t<key>shell</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t\t<key>source</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t</dict>\n\t\t\t\t<key>AMProvides</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Container</key>\n\t\t\t\t\t<string>List</string>\n\t\t\t\t\t<key>Types</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<string>com.apple.cocoa.string</string>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<key>ActionBundlePath</key>\n\t\t\t\t<string>/System/Library/Automator/Run Shell Script.action</string>\n\t\t\t\t<key>ActionName</key>\n\t\t\t\t<string>Run Shell Script</string>\n\t\t\t\t<key>ActionParameters</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>COMMAND_STRING</key>\n\t\t\t\t\t<string>NAME=\"$1\"\nFILE_NAME=\"${NAME}.nosync\"\nDIR_NAME=\"${NAME}.tmp\"\n\nif [ -d \"$1\" ]; then\n  mv \"${NAME}\" \"${DIR_NAME}\" &amp;&amp; ln -s \"${DIR_NAME}\" \"${NAME}\" &amp;&amp; chflags hidden \"${NAME}\"\nelif [ -f \"$1\" ]; then\n  mv \"${NAME}\" \"${FILE_NAME}\" &amp;&amp; ln -s \"${FILE_NAME}\" \"${NAME}\" &amp;&amp; chflags hidden \"${NAME}\"\nfi</string>\n\t\t\t\t\t<key>CheckedForUserDefaultShell</key>\n\t\t\t\t\t<true/>\n\t\t\t\t\t<key>inputMethod</key>\n\t\t\t\t\t<integer>1</integer>\n\t\t\t\t\t<key>shell</key>\n\t\t\t\t\t<string>/bin/sh</string>\n\t\t\t\t\t<key>source</key>\n\t\t\t\t\t<string></string>\n\t\t\t\t</dict>\n\t\t\t\t<key>BundleIdentifier</key>\n\t\t\t\t<string>com.apple.RunShellScript</string>\n\t\t\t\t<key>CFBundleVersion</key>\n\t\t\t\t<string>2.0.3</string>\n\t\t\t\t<key>CanShowSelectedItemsWhenRun</key>\n\t\t\t\t<false/>\n\t\t\t\t<key>CanShowWhenRun</key>\n\t\t\t\t<true/>\n\t\t\t\t<key>Category</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>AMCategoryUtilities</string>\n\t\t\t\t</array>\n\t\t\t\t<key>Class Name</key>\n\t\t\t\t<string>RunShellScriptAction</string>\n\t\t\t\t<key>InputUUID</key>\n\t\t\t\t<string>C1FF256B-B0E9-49B3-9B29-1EAC33F28FAF</string>\n\t\t\t\t<key>Keywords</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>Shell</string>\n\t\t\t\t\t<string>Script</string>\n\t\t\t\t\t<string>Command</string>\n\t\t\t\t\t<string>Run</string>\n\t\t\t\t\t<string>Unix</string>\n\t\t\t\t</array>\n\t\t\t\t<key>OutputUUID</key>\n\t\t\t\t<string>48CF9AED-0B52-4174-A385-9CA96C043332</string>\n\t\t\t\t<key>UUID</key>\n\t\t\t\t<string>B28FCA34-9B06-42EC-B7EE-F8618598FA2C</string>\n\t\t\t\t<key>UnlocalizedApplications</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>Automator</string>\n\t\t\t\t</array>\n\t\t\t\t<key>arguments</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>0</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>inputMethod</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>1</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<false/>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>CheckedForUserDefaultShell</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>2</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<string></string>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>source</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>3</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<string></string>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>COMMAND_STRING</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>3</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>4</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<string>/bin/sh</string>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>shell</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>4</string>\n\t\t\t\t\t</dict>\n\t\t\t\t</dict>\n\t\t\t\t<key>isViewVisible</key>\n\t\t\t\t<true/>\n\t\t\t\t<key>location</key>\n\t\t\t\t<string>671.500000:305.000000</string>\n\t\t\t\t<key>nibPath</key>\n\t\t\t\t<string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/Base.lproj/main.nib</string>\n\t\t\t</dict>\n\t\t\t<key>isViewVisible</key>\n\t\t\t<true/>\n\t\t</dict>\n\t</array>\n\t<key>connectors</key>\n\t<dict/>\n\t<key>workflowMetaData</key>\n\t<dict>\n\t\t<key>applicationBundleID</key>\n\t\t<string>com.apple.finder</string>\n\t\t<key>applicationBundleIDsByPath</key>\n\t\t<dict>\n\t\t\t<key>/System/Library/CoreServices/Finder.app</key>\n\t\t\t<string>com.apple.finder</string>\n\t\t</dict>\n\t\t<key>applicationPath</key>\n\t\t<string>/System/Library/CoreServices/Finder.app</string>\n\t\t<key>applicationPaths</key>\n\t\t<array>\n\t\t\t<string>/System/Library/CoreServices/Finder.app</string>\n\t\t</array>\n\t\t<key>inputTypeIdentifier</key>\n\t\t<string>com.apple.Automator.fileSystemObject</string>\n\t\t<key>outputTypeIdentifier</key>\n\t\t<string>com.apple.Automator.nothing</string>\n\t\t<key>presentationMode</key>\n\t\t<integer>15</integer>\n\t\t<key>processesInput</key>\n\t\t<integer>0</integer>\n\t\t<key>serviceApplicationBundleID</key>\n\t\t<string>com.apple.finder</string>\n\t\t<key>serviceApplicationPath</key>\n\t\t<string>/System/Library/CoreServices/Finder.app</string>\n\t\t<key>serviceInputTypeIdentifier</key>\n\t\t<string>com.apple.Automator.fileSystemObject</string>\n\t\t<key>serviceOutputTypeIdentifier</key>\n\t\t<string>com.apple.Automator.nothing</string>\n\t\t<key>serviceProcessesInput</key>\n\t\t<integer>0</integer>\n\t\t<key>systemImageName</key>\n\t\t<string>NSTouchBariCloud</string>\n\t\t<key>useAutomaticInputType</key>\n\t\t<integer>0</integer>\n\t\t<key>workflowTypeIdentifier</key>\n\t\t<string>com.apple.Automator.servicesMenu</string>\n\t</dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "scripts/iCloud Sync.workflow/Contents/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>NSServices</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>NSBackgroundColorName</key>\n\t\t\t<string>background</string>\n\t\t\t<key>NSIconName</key>\n\t\t\t<string>NSTouchBariCloud</string>\n\t\t\t<key>NSMenuItem</key>\n\t\t\t<dict>\n\t\t\t\t<key>default</key>\n\t\t\t\t<string>iCloud Sync</string>\n\t\t\t</dict>\n\t\t\t<key>NSMessage</key>\n\t\t\t<string>runWorkflowAsService</string>\n\t\t\t<key>NSRequiredContext</key>\n\t\t\t<dict>\n\t\t\t\t<key>NSApplicationIdentifier</key>\n\t\t\t\t<string>com.apple.finder</string>\n\t\t\t</dict>\n\t\t\t<key>NSSendFileTypes</key>\n\t\t\t<array>\n\t\t\t\t<string>public.item</string>\n\t\t\t</array>\n\t\t</dict>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "scripts/iCloud Sync.workflow/Contents/document.wflow",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>AMApplicationBuild</key>\n\t<string>492</string>\n\t<key>AMApplicationVersion</key>\n\t<string>2.10</string>\n\t<key>AMDocumentVersion</key>\n\t<string>2</string>\n\t<key>actions</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>action</key>\n\t\t\t<dict>\n\t\t\t\t<key>AMAccepts</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Container</key>\n\t\t\t\t\t<string>List</string>\n\t\t\t\t\t<key>Optional</key>\n\t\t\t\t\t<true/>\n\t\t\t\t\t<key>Types</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<string>com.apple.cocoa.string</string>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<key>AMActionVersion</key>\n\t\t\t\t<string>2.0.3</string>\n\t\t\t\t<key>AMApplication</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>Automator</string>\n\t\t\t\t</array>\n\t\t\t\t<key>AMParameterProperties</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>COMMAND_STRING</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t\t<key>CheckedForUserDefaultShell</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t\t<key>inputMethod</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t\t<key>shell</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t\t<key>source</key>\n\t\t\t\t\t<dict/>\n\t\t\t\t</dict>\n\t\t\t\t<key>AMProvides</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Container</key>\n\t\t\t\t\t<string>List</string>\n\t\t\t\t\t<key>Types</key>\n\t\t\t\t\t<array>\n\t\t\t\t\t\t<string>com.apple.cocoa.string</string>\n\t\t\t\t\t</array>\n\t\t\t\t</dict>\n\t\t\t\t<key>ActionBundlePath</key>\n\t\t\t\t<string>/System/Library/Automator/Run Shell Script.action</string>\n\t\t\t\t<key>ActionName</key>\n\t\t\t\t<string>Run Shell Script</string>\n\t\t\t\t<key>ActionParameters</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>COMMAND_STRING</key>\n\t\t\t\t\t<string>TEMP=\"$(readlink \"$1\")\"\n\nif [[ -L \"$1\" ]]; then\n  rm -rf \"$1\" &amp;&amp; cp -rf \"${TEMP}\" \"$1\" &amp;&amp; rm -rf \"${TEMP}\"\nfi</string>\n\t\t\t\t\t<key>CheckedForUserDefaultShell</key>\n\t\t\t\t\t<true/>\n\t\t\t\t\t<key>inputMethod</key>\n\t\t\t\t\t<integer>1</integer>\n\t\t\t\t\t<key>shell</key>\n\t\t\t\t\t<string>/bin/sh</string>\n\t\t\t\t\t<key>source</key>\n\t\t\t\t\t<string></string>\n\t\t\t\t</dict>\n\t\t\t\t<key>BundleIdentifier</key>\n\t\t\t\t<string>com.apple.RunShellScript</string>\n\t\t\t\t<key>CFBundleVersion</key>\n\t\t\t\t<string>2.0.3</string>\n\t\t\t\t<key>CanShowSelectedItemsWhenRun</key>\n\t\t\t\t<false/>\n\t\t\t\t<key>CanShowWhenRun</key>\n\t\t\t\t<true/>\n\t\t\t\t<key>Category</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>AMCategoryUtilities</string>\n\t\t\t\t</array>\n\t\t\t\t<key>Class Name</key>\n\t\t\t\t<string>RunShellScriptAction</string>\n\t\t\t\t<key>InputUUID</key>\n\t\t\t\t<string>7D0D2AF0-F6C0-4EAC-AF4D-C5CCD5F16301</string>\n\t\t\t\t<key>Keywords</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>Shell</string>\n\t\t\t\t\t<string>Script</string>\n\t\t\t\t\t<string>Command</string>\n\t\t\t\t\t<string>Run</string>\n\t\t\t\t\t<string>Unix</string>\n\t\t\t\t</array>\n\t\t\t\t<key>OutputUUID</key>\n\t\t\t\t<string>B765991D-EFFE-419E-8534-BF253C123C9A</string>\n\t\t\t\t<key>UUID</key>\n\t\t\t\t<string>9F187A6A-053D-47B4-88F8-37AE5A9CC4EB</string>\n\t\t\t\t<key>UnlocalizedApplications</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>Automator</string>\n\t\t\t\t</array>\n\t\t\t\t<key>arguments</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>0</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<integer>0</integer>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>inputMethod</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>1</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<false/>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>CheckedForUserDefaultShell</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>2</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<string></string>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>source</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>2</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>3</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<string></string>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>COMMAND_STRING</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>3</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>4</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>default value</key>\n\t\t\t\t\t\t<string>/bin/sh</string>\n\t\t\t\t\t\t<key>name</key>\n\t\t\t\t\t\t<string>shell</string>\n\t\t\t\t\t\t<key>required</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>type</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>uuid</key>\n\t\t\t\t\t\t<string>4</string>\n\t\t\t\t\t</dict>\n\t\t\t\t</dict>\n\t\t\t\t<key>isViewVisible</key>\n\t\t\t\t<true/>\n\t\t\t\t<key>location</key>\n\t\t\t\t<string>624.750000:305.000000</string>\n\t\t\t\t<key>nibPath</key>\n\t\t\t\t<string>/System/Library/Automator/Run Shell Script.action/Contents/Resources/Base.lproj/main.nib</string>\n\t\t\t</dict>\n\t\t\t<key>isViewVisible</key>\n\t\t\t<true/>\n\t\t</dict>\n\t</array>\n\t<key>connectors</key>\n\t<dict/>\n\t<key>workflowMetaData</key>\n\t<dict>\n\t\t<key>applicationBundleID</key>\n\t\t<string>com.apple.finder</string>\n\t\t<key>applicationBundleIDsByPath</key>\n\t\t<dict>\n\t\t\t<key>/System/Library/CoreServices/Finder.app</key>\n\t\t\t<string>com.apple.finder</string>\n\t\t</dict>\n\t\t<key>applicationPath</key>\n\t\t<string>/System/Library/CoreServices/Finder.app</string>\n\t\t<key>applicationPaths</key>\n\t\t<array>\n\t\t\t<string>/System/Library/CoreServices/Finder.app</string>\n\t\t</array>\n\t\t<key>inputTypeIdentifier</key>\n\t\t<string>com.apple.Automator.fileSystemObject</string>\n\t\t<key>outputTypeIdentifier</key>\n\t\t<string>com.apple.Automator.nothing</string>\n\t\t<key>presentationMode</key>\n\t\t<integer>15</integer>\n\t\t<key>processesInput</key>\n\t\t<integer>0</integer>\n\t\t<key>serviceApplicationBundleID</key>\n\t\t<string>com.apple.finder</string>\n\t\t<key>serviceApplicationPath</key>\n\t\t<string>/System/Library/CoreServices/Finder.app</string>\n\t\t<key>serviceInputTypeIdentifier</key>\n\t\t<string>com.apple.Automator.fileSystemObject</string>\n\t\t<key>serviceOutputTypeIdentifier</key>\n\t\t<string>com.apple.Automator.nothing</string>\n\t\t<key>serviceProcessesInput</key>\n\t\t<integer>0</integer>\n\t\t<key>systemImageName</key>\n\t\t<string>NSTouchBariCloud</string>\n\t\t<key>useAutomaticInputType</key>\n\t\t<integer>0</integer>\n\t\t<key>workflowTypeIdentifier</key>\n\t\t<string>com.apple.Automator.servicesMenu</string>\n\t</dict>\n</dict>\n</plist>\n"
  },
  {
    "path": "utils/install.zsh",
    "content": "#!/bin/zsh\n\n#\n# Install iCloud NoSync.\n#\n\n# Detects the Operating System\nif [[ \"$OSTYPE\" != \"darwin\"* ]]; then\n  echo \"This script is only compatible with macOS\" >&2\n  exit 1\nfi\n\n# Define the Services directory\nAPPLE_SERVICES=\"${HOME}/Library/Services\"\n\n# Detects which macOS version\nSW_VERS=$(sw_vers -buildVersion)\nOS_VERS=$(sed -E -e 's/([0-9]{2}).*/\\1/' <<< \"$SW_VERS\")\nif [[ \"$OS_VERS\" -ge 14 ]]; then\n  echo \"\\niCloud NoSync: Starting the installation process...\"\n\n  # Copies files into the Services directory using the absolute path.\n  if cp -r \"${0:A:h}/../scripts/iCloud No Sync.workflow\" \"${APPLE_SERVICES}\" && \\\n    cp -r \"${0:A:h}/../scripts/iCloud Sync.workflow\" \"${APPLE_SERVICES}\"; then\n    echo \"iCloud NoSync: The workflow files have been copied into the Services directory.\"\n\n    echo \"\\niCloud NoSync: Opening the Privacy & Security Panel in System Settings...\"\n    sleep 2 && open \"x-apple.systempreferences:com.apple.preferences.extensions\"\n\n    # Guide the user to enable the Quick Actions in Finder.\n    echo \"\\niCloud NoSync: From the Privacy & Security Panel open Finder.\"\n    echo \"iCloud NoSync: Check 'iCloud No Sync' and 'iCloud Sync' Quick Actions.\"\n  else\n    echo \"iCloud NoSync: Error occurred while copying the workflow files.\" >&2\n    exit 1\n  fi\nelse\n  echo \"\\niCloud NoSync:\"\n  echo \"Looks like this Mac is running an earlier version of macOS. \"\n  echo \"To be able to use and sync files, iCloud Drive requires     \"\n  echo \"OS X Yosemite 10.10 or a later version of system software.  \"\n  echo \"Please visit: https://support.apple.com/en-us/HT204025      \"\nfi\n"
  },
  {
    "path": "utils/uninstall.zsh",
    "content": "#!/bin/zsh\n\n#\n# Uninstall iCloud NoSync.\n#\n\n# Detects the Operating System.\nif [[ \"$OSTYPE\" != \"darwin\"* ]]; then\n  echo \"This script is only compatible with macOS\" >&2\n  exit 1\nfi\n\necho \"\\niCloud NoSync: Starting the removal process...\"\n\n# Defines the Services directory and the workflow files.\nAPPLE_SERVICES=\"${HOME}/Library/Services\"\nNO_SYNC=iCloud\\ No\\ Sync.workflow\nSYNC=iCloud\\ Sync.workflow\n\n# Removes workflow files inside the Services directory.\nfor file in \"${APPLE_SERVICES}\"/{\"$NO_SYNC\",\"$SYNC\"}; do\n  [[ -r \"$file\" ]] && rm -rf \"${file}\"\ndone\n\n# Prints a success message.\necho \"iCloud NoSync: The workflow files have been removed.\"\n"
  }
]