{"body":{"post":{"id":"2i4g3u20446d0o6u3o0v","title":"MacOS Finder에서 파일 링크를 마크다운 형태로 복사하기","content":"---\nMOC: \ncreated: 2025-05-03 12:54:23\nupdated: 2025-05-04 12:58:35\nurl: https://obsius.site/2i4g3u20446d0o6u3o0v\n---\n\n[Better File Link for Obsidian 플러그인](https://github.com/marcjulianschwarz/obsidian-file-link) 을 사용하면 외부 파일 링크를 옵시디언 노트에 마크다운 링크 형태로 삽입할 수 있습니다.\n\n![|200](https://i.imgur.com/a81rmEe.png)\n\n노트에는 아래와 같은 형태로 삽입됩니다.\n\n```\n[1-1 LLM과 RAG의 개념.pdf](<file:////Users/anpigon/Documents/1-1 LLM과 RAG의 개념.pdf>)\n```\n\n위 방법은 개별 파일 링크 삽입에 유용하지만, 여러 파일 링크를 한번에 처리할 때는 다소 번거로울 수 있습니다.\n\nFinder에서 여러 파일을 선택하고 바로 마크다운 링크로 복사할 수 있다면 훨씬 효율적일 것입니다. 이를 위해 Automator를 사용하여 간단한 워크플로우를 만들어 보았습니다.\n\n## Automator 워크플로우 생성 방법\n\n다음과 같은 방법으로 Automator 워크플로우를 생성할 수 있습니다:\n\n1. Automator 앱을 실행합니다.\n2. 새 문서를 생성할 때 \"빠른 액션(Quick Action)\" 워크플로우 유형을 선택합니다.\n3. 워크플로우 설정:\n    - 입력 항목 받기: \"파일 또는 폴더(Files or Folders)\"\n    - 응용 프로그램: \"Finder\"\n\n이제 다음 단계로 워크플로우를 구성해 보겠습니다:\n\n위 스크립트를 사용하여 Automator 워크플로우를 다음과 같이 구성하세요:\n\n1. 우선 Automator에서 워크플로우 설정을 완료한 후, 왼쪽 라이브러리에서 \"Apple 스크립트 실행(Run AppleScript)\" 액션을 검색하여 워크플로우에 추가합니다.\n2. 추가된 \"Apple 스크립트 실행\" 액션의 기본 코드를 지우고, 제가 제공한 AppleScript 코드를 붙여넣습니다.\n3. 워크플로우 저장 시 \"Finder 선택 항목을 Markdown 링크로 복사\" 등의 이름으로 저장합니다.\n\n![](https://i.imgur.com/7P2YA8Y.png)\n\n```\non run {input, parameters}\n\t\n\tset markdownText to \"\"\n\t\n\trepeat with theItem in input\n\t\tset itemPath to POSIX path of theItem\n\t\tset itemName to name of (info for theItem)\n\t\t\n\t\t-- Markdown 형식의 링크 만들기: ![파일명](파일 전체 경로)\n\t\tset markdownLink to \"[\" & itemName & \"](<file:///\" & itemPath & \">)\"\n\t\t\n\t\tif markdownText is \"\" then\n\t\t\tset markdownText to markdownLink\n\t\telse\n\t\t\tset markdownText to markdownText & return & markdownLink\n\t\tend if\n\tend repeat\n\t\n\t-- 결과 텍스트를 클립보드에 복사\n\tset the clipboard to markdownText\n\t\n\treturn input\nend run\n```\n\n\n이 워크플로우가 하는 일은:\n\n- Finder에서 선택한 각 파일이나 폴더에 대해\n- 파일 이름과 전체 경로를 가져와서\n- `[파일명](<file:///파일 전체 경로>)` 형식의 Markdown 링크를 생성합니다\n- 여러 파일이 선택된 경우 각 링크는 새 줄에 배치됩니다\n- 최종 결과를 클립보드에 복사합니다\n\n워크플로우를 저장한 후에는 Finder에서 파일을 선택하고 마우스 오른쪽 버튼을 클릭한 다음, 서비스(또는 빠른 액션) 메뉴에서 생성한 워크플로우 이름을 선택하여 실행할 수 있습니다.\n\n![](https://i.imgur.com/sJJegsG.png)\n\n이제 이 워크플로우를 사용하면 Finder에서 선택한 항목이  `[파일명](<file:///파일 전체 경로>)`  형식으로 클립보드에 복사되어 필요한 곳에 붙여넣을 수 있습니다.\n\n---\n\n모든 설정 과정을 [박준님](https://bio.link/joonpark)께서 영상으로 제작해 공유해주셨습니다.\n\n<div style=\"padding:64.86% 0 0 0;position:relative;\"><iframe src=\"https://player.vimeo.com/video/1081119806?h=67bca1e123&amp;badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media\" style=\"position:absolute;top:0;left:0;width:100%;height:100%;\" title=\"KakaoTalk_Video_2025-05-04-00-37-11\"></iframe></div>\n\n<br>\n\n여러 파일을 선택하고 한번에 마크다운 형식의 파일 링크를 복사하는 것도 가능합니다.\n![](https://i.imgur.com/3pkqwFP.gif)\n\n"}}}