{"id":1657,"date":"2024-06-07T10:40:06","date_gmt":"2024-06-07T16:40:06","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=1657"},"modified":"2024-06-07T10:40:06","modified_gmt":"2024-06-07T16:40:06","slug":"xattrs","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2024\/06\/07\/xattrs\/","title":{"rendered":"Xattrs"},"content":{"rendered":"\n<p>Lord I hate these things<br><br>So here&#8217;s a little droplet, in AppleScript, to remove them<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>Yes I thought about writing it in <em>something else<\/em><br>But the AppleScript is 213 K and just about everything else would be quite a bit larger<\/p>\n\n\n\n<p>Some, many megabytes<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>The ENTIRE text is as follows<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n-- This droplet processes files dropped onto the applet \non open these_items\n  repeat with i from 1 to the count of these_items\n    set this_item to item i of these_items\n    set the item_info to info for this_item\n    if folder of the item_info is true then\n      process_folder(this_item)\n    else\n      try\n        set this_extension to the name extension of item_info\n      on error\n        set this_extension to \"\"\n      end try\n      try\n        set this_filetype to the file type of item_info\n      on error\n        set this_filetype to \"\"\n      end try\n      try\n        set this_typeID to the type identifier of item_info\n      on error\n        set this_typeID to \"\"\n      end try\n      if (folder of the item_info is false) and (package folder of the item_info is false) and (alias of the item_info is false) then\n        process_file(this_item)\n      end if\n    end if\n  end repeat\nend open\n\n-- this sub-routine processes folders \non process_folder(this_folder)\n  set these_items to list folder this_folder without invisibles\n  repeat with i from 1 to the count of these_items\n    set this_item to alias ((this_folder as Unicode text) &amp; (item i of these_items))\n    set the item_info to info for this_item\n    if folder of the item_info is true then\n      process_folder(this_item)\n    else\n      try\n        set this_extension to the name extension of item_info\n      on error\n        set this_extension to \"\"\n      end try\n      try\n        set this_filetype to the file type of item_info\n      on error\n        set this_filetype to \"\"\n      end try\n      try\n        set this_typeID to the type identifier of item_info\n      on error\n        set this_typeID to \"\"\n      end try\n      if (folder of the item_info is false) and (package folder of the item_info is false) and (alias of the item_info is false) then\n        process_file(this_item)\n      end if\n    end if\n  end repeat\nend process_folder\n\n-- this sub-routine processes files \non process_file(this_item)\n  -- NOTE that during execution, the variable this_item contains a file reference in alias format to the item passed into this sub-routine\n  -- FILE PROCESSING STATEMENTS GO HERE\n  set thePathToFile to POSIX path of this_item\n  log thePathToFile\n  \n  set theresult to do shell script \"\/usr\/bin\/xattr \\\"\" &amp; thePathToFile &amp; \"\\\"\" as text\n  --  log theresult\n  \n  set theParagraphs to paragraphs of theresult\n  repeat with i from 1 to length of theParagraphs\n    set theCurrentListItem to item i of theParagraphs\n    -- Process the current list item\n    -- log \" line\" &amp; (i as text) &amp; \" = &#91;\" &amp; theCurrentListItem &amp; \"]\"\n    \n    do shell script \"\/usr\/bin\/xattr -d \" &amp; theCurrentListItem &amp; \" \\\"\" &amp; thePathToFile &amp; \"\\\"\"\n    \n  end repeat\n  \nend process_file\n\n\n<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lord I hate these things So here&#8217;s a little droplet, in AppleScript, to remove them Yes I thought about writing it in something elseBut the AppleScript is 213 K and just about everything else would be quite a bit larger Some, many megabytes The ENTIRE text is as follows<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1657","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1657","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/comments?post=1657"}],"version-history":[{"count":1,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1657\/revisions"}],"predecessor-version":[{"id":1658,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1657\/revisions\/1658"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=1657"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=1657"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=1657"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}