0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

スティッキーズを表示するだけのシンプルなAppleScript

Posted at

どういうものか

実行するとスティッキーズを起動し、
もし付箋がなければ新しく右上に作成するだけの簡単なAppleScriptです。

コード

-- スティッキーズアプリケーションを起動
tell application "Stickies"
	activate
end tell

tell application "System Events" to tell process "Stickies"
	-- 前面に出す
	set frontmost to true
	
	-- stickyが一つもない時の処理
	if (count of windows) = 0 then
		-- メニューを叩いて新しいstickyを作成する
		tell menu item 1 of menu 3 of menu bar 1 to click
		-- 画面左上に移動する
		set size of window 1 to {350, 220}
		set position of window 1 to {50, 50}
	end if
end tell
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?