{"id":11142,"date":"2026-02-24T12:35:10","date_gmt":"2026-02-24T03:35:10","guid":{"rendered":"https:\/\/code-plus.jp\/gp\/?p=11142"},"modified":"2026-06-04T00:03:57","modified_gmt":"2026-06-03T15:03:57","slug":"mac-screenshot-11142","status":"publish","type":"post","link":"https:\/\/code-plus.jp\/gp\/mac-screenshot-11142\/","title":{"rendered":"Mac\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u30921\u30af\u30ea\u30c3\u30af\u3067\u30ea\u30cd\u30fc\u30e0\u3059\u308b\u65b9\u6cd5\u3010AppleScript\u30a2\u30d7\u30ea\u3067\u30fbmacOS Sequoia\u5bfe\u5fdc\u3011"},"content":{"rendered":"<!-- title: Mac\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u30921\u30af\u30ea\u30c3\u30af\u3067\u30ea\u30cd\u30fc\u30e0\u3059\u308b\u65b9\u6cd5\u3010AppleScript\u30a2\u30d7\u30ea\u3067\u30fbmacOS Sequoia\u5bfe\u5fdc\u3011\r\ndescription: Mac\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u9577\u3044\u30d5\u30a1\u30a4\u30eb\u540d\uff08\u4f8b\uff1a\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2026-05-07 12.34.56.png\uff09\u3092\u300cSS-20260507-123456.png\u300d\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u5f62\u5f0f\u306b1\u30af\u30ea\u30c3\u30af\u3067\u4e00\u62ec\u30ea\u30cd\u30fc\u30e0\u3002AppleScript\u30a2\u30d7\u30ea\u5316\u3067Dock\u304b\u3089\u5373\u5b9f\u884c\u3001macOS Sequoia (15) \u4ee5\u964d\u3067\u3082\u5b89\u5b9a\u52d5\u4f5c\u3059\u308b\u78ba\u5b9f\u306a\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002\r\ntags: Mac, macOS, macOS Sequoia, \u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8, \u30d5\u30a1\u30a4\u30eb\u540d, \u30ea\u30cd\u30fc\u30e0, \u81ea\u52d5\u5316, AppleScript, \u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8, Bash, Tips, \u52b9\u7387\u5316 -->\r\n<p>Mac\u3067\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u308b\u3068\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f <code>\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2026-05-07 12.34.56.png<\/code> \u306e\u3088\u3046\u306a\u65e5\u672c\u8a9e\u6df7\u3058\u308a\u306e\u9577\u3044\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u306a\u308a\u307e\u3059\u3002Slack\u306b\u8cbc\u308a\u4ed8\u3051\u308b\u3068\u304d\u3001Finder\u3067\u4e26\u3079\u305f\u3044\u3068\u304d\u3001Git\u30ea\u30dd\u30b8\u30c8\u30ea\u306b\u30b3\u30df\u30c3\u30c8\u3057\u305f\u3044\u3068\u304d\u2014\u2014\u3053\u306e\u540d\u524d\u306f\u4f55\u304b\u3068\u90aa\u9b54\u3067\u3059\u3002<\/p>\r\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3068 AppleScript \u30a2\u30d7\u30ea\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3001<code>SS-20260507-123456.png<\/code> \u306e\u3088\u3046\u306a\u30b7\u30f3\u30d7\u30eb\u306a\u5f62\u5f0f\u306b <b class=\"bold\">Dock\u304b\u30891\u30af\u30ea\u30c3\u30af<\/b> \u3067\u4e00\u62ec\u30ea\u30cd\u30fc\u30e0\u3059\u308b\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\r\n<p>\u904e\u53bb\u306b\u306fAutomator\u306e\u30d5\u30a9\u30eb\u30c0\u30a2\u30af\u30b7\u30e7\u30f3\u3067\u81ea\u52d5\u5316\u3059\u308b\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3057\u305f\u304c\u3001macOS Sequoia (15) \u4ee5\u964d\u3067\u30d5\u30a9\u30eb\u30c0\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u6975\u3081\u3066\u4e0d\u5b89\u5b9a\u306b\u306a\u3063\u305f\u305f\u3081\u3001\u672c\u8a18\u4e8b\u3067\u306f\u3088\u308a\u78ba\u5b9f\u306a\u300cAppleScript\u30a2\u30d7\u30ea\u300d\u65b9\u5f0f\u3092\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\r\n\r\n<!-- \u2605\u76ee\u6b21\u30ea\u30b9\u30c8 -->\r\n<ul class=\"tocList mt-1r\" data-toc-id=\"js-tocBWGD\" style=\"height:28rem\"><\/ul>\r\n<ins class=\"tocBtn is-fixed\" data-toc-id=\"js-tocBWGD\"><\/ins>\r\n\r\n\r\n\r\n\r\n\r\n<h2 class=\"fz-xl\">\u30b4\u30fc\u30eb<\/h2>\r\n<p><b class=\"bold\">Before:<\/b><\/p>\r\n<pre><code class=\"language-\">\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2026-05-07 12.34.56.png\r\n\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2026-05-07 12.34.56\uff082\uff09.png\r\n<\/code><\/pre>\r\n<p><b class=\"bold\">After:<\/b><\/p>\r\n<pre><code class=\"language-\">SS-20260507-123456.png\r\nSS-20260507-123456(2).png\r\n<\/code><\/pre>\r\n<p>Dock\u306b\u7f6e\u3044\u305f <code>Rename Screenshots.app<\/code> \u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3060\u3051\u3067\u3001\u4fdd\u5b58\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u5bfe\u8c61\u30d5\u30a1\u30a4\u30eb\u304c\u3059\u3079\u3066\u5909\u63db\u3055\u308c\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<h2 class=\"fz-xl\">1. \u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u5909\u66f4<\/h2>\r\n<p>\u307e\u305a\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u3001\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u5148\u982d\u6587\u5b57\u5217\u3092\u300cSS-\u300d\u306b\u5909\u3048\u307e\u3059\u3002<\/p>\r\n<pre><code class=\"language-bash\">defaults write com.apple.screencapture name &quot;SS-&quot;\r\n<\/code><\/pre>\r\n<p>\u3053\u308c\u3067 <code>SS- 2026-05-07 12.34.56.png<\/code> \u3068\u3044\u3046\u5f62\u5f0f\u3067\u4fdd\u5b58\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\r\n<blockquote>\r\n  <p><b class=\"bold\">\u5143\u306b\u623b\u3057\u305f\u3044\u5834\u5408<\/b><\/p>\r\n  <pre><code class=\"language-bash\">defaults delete com.apple.screencapture name\r\n<\/code><\/pre>\r\n<\/blockquote>\r\n\r\n\r\n<h2 class=\"fz-xl\">2. \u30ea\u30cd\u30fc\u30e0\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210<\/h2>\r\n<p>\u30b9\u30af\u30ea\u30d7\u30c8\u7f6e\u304d\u5834\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u307e\u3059\uff08\u65e2\u306b\u3042\u308c\u3070\u4e0d\u8981\uff09\u3002<\/p>\r\n<pre><code class=\"language-bash\">mkdir -p ~\/Library\/Scripts\r\n<\/code><\/pre>\r\n<p><code>~\/Library\/Scripts\/rename-screenshot.sh<\/code> \u306b\u4ee5\u4e0b\u3092\u4fdd\u5b58\uff1a<\/p>\r\n<pre><code class=\"language-bash\">#!\/bin\/bash\r\nWATCH_DIR=&quot;$HOME\/Documents&quot;\r\ncd &quot;$WATCH_DIR&quot; || exit 0\r\n\r\nshopt -s nullglob\r\nfor f in &quot;SS- &quot;*.png; do\r\n    # \u5168\u89d2\u62ec\u5f27\uff08 \uff09\u3092\u534a\u89d2\u306b\u6b63\u898f\u5316\r\n    normalized=&quot;${f\/\/\uff08\/(}&quot;\r\n    normalized=&quot;${normalized\/\/\uff09\/)}&quot;\r\n\r\n    # SS- YYYY-MM-DD HH.MM.SS.png \u307e\u305f\u306f ...\uff08n\uff09.png \u5f62\u5f0f\u306b\u30de\u30c3\u30c1\r\n    if &lsqb;&lsqb; &quot;$normalized&quot; =~ ^SS-\\ (&lsqb;0-9&rsqb;{4})-(&lsqb;0-9&rsqb;{2})-(&lsqb;0-9&rsqb;{2})\\ (&lsqb;0-9&rsqb;{2})\\.(&lsqb;0-9&rsqb;{2})\\.(&lsqb;0-9&rsqb;{2})(\\ ?\\((&lsqb;0-9&rsqb;+)\\))?\\.png$ &rsqb;&rsqb;; then\r\n        if &lsqb;&lsqb; -n &quot;${BASH_REMATCH&lsqb;8&rsqb;}&quot; &rsqb;&rsqb;; then\r\n            suffix=&quot;(${BASH_REMATCH&lsqb;8&rsqb;})&quot;\r\n        else\r\n            suffix=&quot;&quot;\r\n        fi\r\n        newname=&quot;SS-${BASH_REMATCH&lsqb;1&rsqb;}${BASH_REMATCH&lsqb;2&rsqb;}${BASH_REMATCH&lsqb;3&rsqb;}-${BASH_REMATCH&lsqb;4&rsqb;}${BASH_REMATCH&lsqb;5&rsqb;}${BASH_REMATCH&lsqb;6&rsqb;}${suffix}.png&quot;\r\n        mv -- &quot;$f&quot; &quot;$newname&quot;\r\n    fi\r\ndone\r\n<\/code><\/pre>\r\n<p>\u5b9f\u884c\u6a29\u9650\u3092\u4ed8\u4e0e\uff1a<\/p>\r\n<pre><code class=\"language-bash\">chmod +x ~\/Library\/Scripts\/rename-screenshot.sh\r\n<\/code><\/pre>\r\n<h3 class=\"fz-ml\">\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30dd\u30a4\u30f3\u30c8<\/h3>\r\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\r\n  <li><code>WATCH_DIR<\/code>\u306a\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u4fdd\u5b58\u5148\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3057\u307e\u3059\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f <code>~\/Documents<\/code>\u3002\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u4fdd\u5b58\u306a\u3089 <code>~\/Desktop<\/code>\u3002<\/li>\r\n  <li>\u5168\u89d2\u62ec\u5f27\u306e\u6b63\u898f\u5316\u306amacOS\u306f\u91cd\u8907\u6642\u306e\u30b5\u30d5\u30a3\u30c3\u30af\u30b9\u3068\u3057\u3066 <code>\uff082\uff09<\/code> \u306e\u3088\u3046\u306a\u5168\u89d2\u62ec\u5f27\u3092\u751f\u6210\u3059\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\uff08\u7279\u306b\u65e5\u672c\u8a9e\u30ed\u30b1\u30fc\u30eb\u74b0\u5883\uff09\u3002\u30b9\u30af\u30ea\u30d7\u30c8\u5192\u982d\u3067\u534a\u89d2\u306b\u6b63\u898f\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u51fa\u529b\u540d\u306f\u5e38\u306b\u534a\u89d2 <code>(2)<\/code> \u306b\u7d71\u4e00\u3055\u308c\u307e\u3059\u3002<\/li>\r\n  <li><code>shopt -s nullglob<\/code>\u306a\u5bfe\u8c61\u30d5\u30a1\u30a4\u30eb\u304c\u30bc\u30ed\u4ef6\u306e\u3068\u304d\u306b for \u30eb\u30fc\u30d7\u304c\u7a7a\u56de\u308a\u3057\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u4fdd\u967a\u3002<\/li>\r\n<\/ul>\r\n<h3 class=\"fz-ml\">\u5358\u4f53\u52d5\u4f5c\u30c6\u30b9\u30c8<\/h3>\r\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089\u76f4\u63a5\u53e9\u3044\u3066\u3001\u30ea\u30cd\u30fc\u30e0\u304c\u884c\u308f\u308c\u308b\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\r\n<pre><code class=\"language-bash\">~\/Library\/Scripts\/rename-screenshot.sh\r\nls ~\/Documents | grep &quot;SS-&quot;\r\n<\/code><\/pre>\r\n<p><code>SS-20260507-123456.png<\/code> \u5f62\u5f0f\u306b\u5909\u308f\u3063\u3066\u3044\u308c\u3070\u6210\u529f\u3067\u3059\u3002<\/p>\r\n\r\n\r\n<h2 class=\"fz-xl\">3. AppleScript \u3067\u30a2\u30d7\u30ea\u5316<\/h2>\r\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u958b\u304b\u305a\u3001Dock\u304b\u30891\u30af\u30ea\u30c3\u30af\u3067\u5b9f\u884c\u3067\u304d\u308b\u30a2\u30d7\u30ea\u306b\u3057\u307e\u3059\u3002<\/p>\r\n<h3 class=\"fz-ml\">\u624b\u9806<\/h3>\r\n<ol style=\"list-style-type:decimal;\" class=\"my-0.5r\">\r\n  <li>\r\n    <p><b class=\"bold\">\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u3092\u8d77\u52d5<\/b><br \/>\r\n      Spotlight\uff08\u2318+Space\uff09\u3067\u300c\u30b9\u30af\u30ea\u30d7\u30c8\u30a8\u30c7\u30a3\u30bf\u300d\u3068\u5165\u529b\u3057\u3066\u8d77\u52d5\u3002<\/p>\r\n  <\/li>\r\n  <li>\r\n    <p><b class=\"bold\">\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8cbc\u308a\u4ed8\u3051<\/b><\/p>\r\n    <pre><code class=\"language-applescript\">do shell script &quot;$HOME\/Library\/Scripts\/rename-screenshot.sh&quot;\r\n<\/code><\/pre>\r\n  <\/li>\r\n  <li>\r\n    <p><b class=\"bold\">\u30a2\u30d7\u30ea\u3068\u3057\u3066\u66f8\u304d\u51fa\u3059<\/b><\/p>\r\n    <ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\r\n      <li>\u30e1\u30cb\u30e5\u30fc\uff1a\u30d5\u30a1\u30a4\u30eb \u2192 \u300c\u66f8\u304d\u51fa\u3059...\u300d<\/li>\r\n      <li>\u540d\u524d\uff1a<code>Rename Screenshots<\/code><\/li>\r\n      <li>\u5834\u6240\uff1a<code>~\/Applications<\/code> \u306a\u3069<\/li>\r\n      <li><b class=\"bold\">\u30d5\u30a1\u30a4\u30eb\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\uff1a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3<\/b><\/li>\r\n      <li>\u300c\u66f8\u304d\u51fa\u3059\u300d\u3092\u30af\u30ea\u30c3\u30af<\/li>\r\n    <\/ul>\r\n  <\/li>\r\n<\/ol>\r\n<p>\u3053\u308c\u3067 <code>Rename Screenshots.app<\/code> \u304c\u5b8c\u6210\u3057\u307e\u3059\u3002\u30c0\u30d6\u30eb\u30af\u30ea\u30c3\u30af\u3067\u5b9f\u884c\u3055\u308c\u3001Terminal\u30a6\u30a4\u30f3\u30c9\u30a6\u306f\u4e00\u5207\u958b\u304d\u307e\u305b\u3093\u3002<\/p>\r\n<h3 class=\"fz-ml\">Dock\u306b\u767b\u9332<\/h3>\r\n<p>\u5b8c\u6210\u3057\u305f <code>.app<\/code> \u3092Dock\u306b\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7\u3067\u767b\u9332\u3067\u304d\u307e\u3059\u3002\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u3063\u305f\u3089Dock\u306e\u30a2\u30a4\u30b3\u30f3\u30921\u30af\u30ea\u30c3\u30af\u3059\u308b\u3060\u3051\u3067\u3001\u5bfe\u8c61\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u6574\u3063\u305f\u540d\u524d\u306b\u30ea\u30cd\u30fc\u30e0\u3055\u308c\u307e\u3059\u3002<\/p>\r\n<h3 class=\"fz-ml\">\u30a2\u30a4\u30b3\u30f3\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\uff08\u4efb\u610f\uff09<\/h3>\r\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u30a2\u30a4\u30b3\u30f3\u304c\u6c17\u306b\u306a\u308b\u5834\u5408\uff1a<\/p>\r\n<ol style=\"list-style-type:decimal;\" class=\"my-0.5r\">\r\n  <li>Finder\u3067 <code>Rename Screenshots.app<\/code> \u3092\u9078\u629e \u2192 \u2318+I \u3067\u300c\u60c5\u5831\u3092\u898b\u308b\u300d<\/li>\r\n  <li>\u5de6\u4e0a\u306e\u5c0f\u3055\u3044\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\uff08\u9752\u3044\u67a0\u304c\u4ed8\u304f\uff09<\/li>\r\n  <li>\u597d\u304d\u306a\u753b\u50cf\uff08PNG\/ICNS\uff09\u3092\u30c9\u30e9\u30c3\u30b0\uff06\u30c9\u30ed\u30c3\u30d7<\/li>\r\n<\/ol>\r\n\r\n\r\n<h2 class=\"fz-xl\">\u52d5\u4f5c\u78ba\u8a8d<\/h2>\r\n<ol style=\"list-style-type:decimal;\" class=\"my-0.5r\">\r\n  <li>\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u3092\u64ae\u5f71\uff08\u2318+Shift+3 \u307e\u305f\u306f \u2318+Shift+4\uff09<\/li>\r\n  <li>Dock\u306e <code>Rename Screenshots<\/code> \u3092\u30af\u30ea\u30c3\u30af<\/li>\r\n  <li>\u6570\u79d2\u5f8c\u3001\u30d5\u30a1\u30a4\u30eb\u540d\u304c <code>SS-20260507-123456.png<\/code> \u5f62\u5f0f\u306b\u5909\u308f\u3063\u3066\u3044\u308c\u3070\u6210\u529f<\/li>\r\n<\/ol>\r\n\r\n\r\n<h2 class=\"fz-xl\">\u30c8\u30e9\u30d6\u30eb\u30b7\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0<\/h2>\r\n<h3 class=\"fz-ml\">\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u5909\u308f\u3089\u306a\u3044\uff08\u30b9\u30da\u30fc\u30b9\u304c\u6b8b\u308b\uff09<\/h3>\r\n<p>macOS Sonoma 14.4 \u4ee5\u964d\u3001\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3067\u65e5\u4ed8\u3068\u6642\u523b\u306e\u9593\u306e\u30b9\u30da\u30fc\u30b9\u304c\u3001\u901a\u5e38\u306e\u534a\u89d2\u30b9\u30da\u30fc\u30b9\uff08U+0020\uff09\u304b\u3089 <b class=\"bold\">\u30ca\u30ed\u30fc\u30fb\u30ce\u30fc\u30d6\u30ec\u30fc\u30af\u30b9\u30da\u30fc\u30b9\uff08U+202F\uff09<\/b> \u306b\u5909\u66f4\u3055\u308c\u305f\u500b\u4f53\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\r\n<p>\u78ba\u8a8d\u65b9\u6cd5\uff1a<\/p>\r\n<pre><code class=\"language-bash\">ls ~\/Documents | grep &quot;SS-&quot; | head -1 | xxd | head -3\r\n<\/code><\/pre>\r\n<p><code>e2 80 af<\/code> \u3068\u3044\u3046\u30d0\u30a4\u30c8\u5217\u304c\u542b\u307e\u308c\u3066\u3044\u308c\u3070 U+202F \u304c\u6df7\u5165\u3057\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u306f\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u6b63\u898f\u5316\u51e6\u7406\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u62e1\u5f35\uff1a<\/p>\r\n<pre><code class=\"language-bash\"># \u5168\u89d2\u62ec\u5f27\u306e\u6b63\u898f\u5316\u306b\u52a0\u3048\u3001\u7279\u6b8a\u30b9\u30da\u30fc\u30b9\u3082\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u306b\u6b63\u898f\u5316\r\nnormalized=&quot;${f\/\/\uff08\/(}&quot;\r\nnormalized=&quot;${normalized\/\/\uff09\/)}&quot;\r\nnormalized=$(printf &#39;%s&#39; &quot;$normalized&quot; | LC_ALL=C sed ___PRE_BLOCK_10___#39;s\/\\xe2\\x80\\xaf\/ \/g; s\/\\xc2\\xa0\/ \/g&#39;)\r\n<\/code><\/pre>\r\n<h3 class=\"fz-ml\">\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u300cSS--.png\u300d\u306b\u306a\u308b<\/h3>\r\n<p>\u30b7\u30a7\u30eb\u304c <code>\/bin\/zsh<\/code> \u3067\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u30b9\u30af\u30ea\u30d7\u30c8\u5148\u982d\u306e shebang \u304c <code>#!\/bin\/bash<\/code> \u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<code>BASH_REMATCH<\/code> \u306fbash\u5c02\u7528\u306e\u6a5f\u80fd\u3067\u3001zsh\u3067\u306f\u52d5\u4f5c\u3057\u307e\u305b\u3093\u3002<\/p>\r\n<h3 class=\"fz-ml\">Automator \u306e\u30d5\u30a9\u30eb\u30c0\u30a2\u30af\u30b7\u30e7\u30f3\u304c\u53cd\u5fdc\u3057\u306a\u3044<\/h3>\r\n<p>\u65e7\u7248\u306e\u8a18\u4e8b\u3067\u306f\u30d5\u30a9\u30eb\u30c0\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001macOS Sequoia (15) \u4ee5\u964d\u306f\u518d\u30a2\u30bf\u30c3\u30c1\u3057\u3066\u3082\u6b21\u56de\u518d\u8d77\u52d5\u3067\u5916\u308c\u308b\u3001\u30b5\u30fc\u30d3\u30b9\u30e1\u30cb\u30e5\u30fc\u306b\u300c\u30d5\u30a9\u30eb\u30c0\u30a2\u30af\u30b7\u30e7\u30f3\u8a2d\u5b9a\u300d\u304c\u51fa\u306a\u3044\u306a\u3069\u3001\u4e0d\u5177\u5408\u5831\u544a\u304c\u591a\u6570\u3042\u308a\u307e\u3059\u3002\u672c\u8a18\u4e8b\u306e AppleScript \u30a2\u30d7\u30ea\u65b9\u5f0f\u306b\u5207\u308a\u66ff\u3048\u308b\u306e\u304c\u6700\u3082\u78ba\u5b9f\u3067\u3059\u3002<\/p>\r\n\r\n\r\n<h2 class=\"fz-xl\">\u306a\u305cAutomator\u3067\u306f\u306a\u304fAppleScript\u30a2\u30d7\u30ea\u306a\u306e\u304b<\/h2>\r\n<table class=\"table my-0.5r\">\r\n  <thead>\r\n    <tr class=\"rung\">\r\n      <th>\u65b9\u5f0f<\/th>\r\n      <td>\u81ea\u52d5\u5316<\/td>\r\n      <td>\u5b89\u5b9a\u6027<\/td>\r\n      <td>\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306e\u7c21\u5358\u3055<\/td>\r\n    <\/tr>\r\n  <\/thead>\r\n  <tbody>\r\n    <tr class=\"rung\">\r\n      <th>Automator \u30d5\u30a9\u30eb\u30c0\u30a2\u30af\u30b7\u30e7\u30f3<\/th>\r\n      <td>\u25ce<\/td>\r\n      <td>\u2715\uff08Sequoia\u4ee5\u964d\u4e0d\u5b89\u5b9a\uff09<\/td>\r\n      <td>\u25cb<\/td>\r\n    <\/tr>\r\n    <tr class=\"rung\">\r\n      <th>launchd + WatchPaths<\/th>\r\n      <td>\u25ce<\/td>\r\n      <td>\u25ce<\/td>\r\n      <td>\u25b3\uff08CLI\u5fc5\u9808\uff09<\/td>\r\n    <\/tr>\r\n    <tr class=\"rung\">\r\n      <th><b class=\"bold\">AppleScript \u30a2\u30d7\u30ea\uff08\u672c\u8a18\u4e8b\uff09<\/b><\/th>\r\n      <td>\u25b3\uff08\u624b\u52d5\u30c8\u30ea\u30ac\u30fc\uff09<\/td>\r\n      <td>\u25ce<\/td>\r\n      <td>\u25ce<\/td>\r\n    <\/tr>\r\n  <\/tbody>\r\n<\/table>\r\n<p>\u300c\u5e38\u306b\u81ea\u52d5\u3067\u52d5\u3044\u3066\u307b\u3057\u3044\u300d\u3088\u308a\u300c\u6c17\u304c\u5411\u3044\u305f\u3068\u304d\u306b\u6574\u7406\u3057\u305f\u3044\u300d\u904b\u7528\u306a\u3089\u3001<b class=\"bold\">AppleScript\u30a2\u30d7\u30ea\u304c\u6700\u3082\u78ba\u5b9f\u3067\u30b7\u30f3\u30d7\u30eb<\/b>\u3067\u3059\u3002Dock\u306b\u30a2\u30a4\u30b3\u30f3\u304c\u5c45\u5ea7\u308a\u7d9a\u3051\u308b\u3053\u3068\u3067\u3001\u6574\u7406\u306e\u7fd2\u6163\u5316\u306b\u3082\u3064\u306a\u304c\u308a\u307e\u3059\u3002<\/p>\r\n\r\n\r\n<h2 class=\"fz-xl\">\u307e\u3068\u3081<\/h2>\r\n<ul style=\"list-style-type:bullet;\" class=\"my-0.5r\">\r\n  <li><code>defaults write com.apple.screencapture name &quot;SS-&quot;<\/code> \u3067\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u5909\u66f4<\/li>\r\n  <li>\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3067 <code>SS-YYYYMMDD-HHMMSS.png<\/code> \u5f62\u5f0f\u306b\u5909\u63db\uff08\u5168\u89d2\u62ec\u5f27\u30fb\u91cd\u8907\u30b5\u30d5\u30a3\u30c3\u30af\u30b9\u306b\u3082\u5bfe\u5fdc\uff09<\/li>\r\n  <li>AppleScript\u30a2\u30d7\u30ea\u5316\u3057\u3066Dock\u304b\u30891\u30af\u30ea\u30c3\u30af\u5b9f\u884c<\/li>\r\n  <li>macOS Sequoia\u4ee5\u964d\u3067\u3082\u5b89\u5b9a\u3057\u3066\u52d5\u4f5c<\/li>\r\n<\/ul>\r\n<p><code>Rename Screenshots.app<\/code> \u3092Dock\u306b\u7f6e\u3044\u3066\u3057\u307e\u3048\u3070\u3001\u7169\u96d1\u306a\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u30b9\u30c3\u30ad\u30ea\u6574\u7406\u3067\u304d\u307e\u3059\u3002<\/p>","protected":false},"excerpt":{"rendered":"Mac\u306e\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8\u306e\u9577\u3044\u30d5\u30a1\u30a4\u30eb\u540d\uff08\u4f8b\uff1a\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2026-05-07 12.34.56.png\uff09\u3092\u300cSS-20260507-123456.png\u300d\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u5f62\u5f0f\u306b1\u30af\u30ea\u30c3\u30af\u3067\u4e00\u62ec\u30ea\u30cd\u30fc\u30e0\u3002AppleScript\u30a2\u30d7\u30ea\u5316\u3067Dock\u304b\u3089\u5373\u5b9f\u884c\u3001macOS Sequoia (15) \u4ee5\u964d\u3067\u3082\u5b89\u5b9a\u52d5\u4f5c\u3059\u308b\u78ba\u5b9f\u306a\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u307e\u3059\u3002","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","footnotes":"","vk-ltc-link":"","vk-ltc-target":"0"},"categories":[10],"tags":[865,864,863,862,585,398,364,315,213,186,190,191],"class_list":["post-11142","post","type-post","status-publish","format-standard","category-develop-env","tag-tips","tag-864","tag-863","tag-macos-sequoia","tag-585","tag-bash","tag-364","tag-macos","tag-213","tag-mac","tag-applescript","tag-191"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/11142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/comments?post=11142"}],"version-history":[{"count":1,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/11142\/revisions"}],"predecessor-version":[{"id":12662,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/posts\/11142\/revisions\/12662"}],"wp:attachment":[{"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/media?parent=11142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/categories?post=11142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-plus.jp\/gp\/wp-json\/wp\/v2\/tags?post=11142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}