Skip to content

Instantly share code, notes, and snippets.

@xVir
Last active August 2, 2018 22:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xVir/4bbd8f9414240f395c65 to your computer and use it in GitHub Desktop.
Save xVir/4bbd8f9414240f395c65 to your computer and use it in GitHub Desktop.
Полезный скрипт для automator

Как скопировать путь к файлу в Finder

Этот скрипт для Automator позволяет добавить в Finder кнопку "Скопировать текущий путь". Если в Finder выбран файл или папка, то будет скопирован путь к соответствующему объекту. Если ничего не выбрано, то будет скопирован путь к текущей папке.

tell application "Finder"
	set sel to the selection as text
	if sel = "" then
		set sel to the insertion location as text
	end if
	
	if not sel = "" then
		set the clipboard to POSIX path of sel
	end if
end tell

Я повесил этот скрипт на сочетание клавиш Cmd+Shift+C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment