5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

appleScriptの割と使えるコード集

Last updated at Posted at 2016-01-06

最近使い始めて便利だと思ったscript達です。
私はgestrと言うアプリで主にscriptを利用しています。
http://mhuusko5.com/#gestr
とても便利なのでぜひ使ってみて下さい。

safariで新しいwindowを開く

tell application "Safari" to activate
tell application "System Events"
	keystroke "n" using {command down}
end tell

safariで一番手前のwindowのURLをクリップボードにコピー

tell application "Safari"
	set pageURI to get URL of current tab of window 1
	set the clipboard to pageURI
end tell

macの音量をミュートにする

set volume with output muted 
get volume settings

ミュート解除

set volume without output muted 
get volume settings

デスクトップに新しいファイルを作る

tell application "Finder"
	make new folder at desktop
end tell

現在のwindowやtabを閉じる

tell application ((path to frontmost application) as Unicode text) to activate
tell application "System Events" to keystroke "w" using command down

現在のapplicationを終了する

tell application ((path to frontmost application) as Unicode text) to activate
tell application "System Events" to keystroke "q" using command down
5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?