ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Mac automator snippet
    카테고리 없음 2020. 1. 5. 01:00

    들어가며

    Windows의 경우 응용프로그램 대부분이 Context menu에 편리한 기능을 자동으로 등록을 해주지만,

    Mac. 은 그런 기능이 거의 없다.

     

    이번 글은 Mac Application에 있는 Automator를 사용하여 조금 더 편리한 작업 환경을 만들어 보는 방법에 대해 알아보고자 한다.

     

    Automator 등록 방법

    1. Launchpad에 Automator를 열고(기타에 있을 수 있음)
    2. 파일 -> 신규 -> 서비스를 선택
    3. Service Receives(서비스가 받는 선택 항목)를 files or folders(파일 또는 폴더)로 바꾼다.

     

    Finder에서 터미널 열기

    보관함에서 Run apple script을 등록한다.

    tell application "Finder"
    	set theWin to (quoted form of POSIX path of (target of window 1 as alias))
    	tell application "Terminal"
    		activate
    		tell window 1
    			do script "cd " & theWin
    		end tell
    	end tell
    end tell

     

    Finder에서 VS Code 열기

    보관함에서 Run shell script(Shell script 실행)을 등록하고,

    as input(통과 입력)을 as arguments(변수)로 바꾸고Shell을 입력한다.

    open -n -b "com.microsoft.VSCode" --args "$*"

     

    댓글

uznam8x