V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
mobpsycho100
V2EX  ›  Alfred

改变 Notes 的字体颜色

  •  
  •   mobpsycho100 · Jan 30, 2022 · 2088 views
    This topic created in 1548 days ago, the information mentioned may be changed or developed.

    Notes 是一个很好用的富文本编辑器, 但是缺少 markdown 的一些实用的特性, 例如 code block 和 math mode. 为了在 notes 中模仿 (inline) code block 功能, 我们可以用紫色字体来写代码. 这个 AppleScript 提供了切换字体颜色的功能, 需要配合 Alfred 在 notes 激活的情况下使用(例如绑定快捷键 cmd+shift+c).

    预设: 打开 Notes-Format-Font-Show Colors, 切换到 Color Palettes, 设置底部的第一个和第二个快捷颜色(例如黑色和紫色). 下方的 AppleScript 将修改字体颜色 (例如将黑色变为紫色, 或者反过来).

    tell application "System Events"
    	repeat while not (exists window "Colors" of application process "Notes")
    		try
    			click menu item "Show Colors" of menu 1 of menu item "Font" of menu 1 of menu bar item "Format" of menu bar 1 of application process "Notes"
    		end try
    	end repeat
    	
    	click UI element 3 of toolbar 1 of window "Colors" of application process "Notes"
    
    	set currentColor to value of color well 1 of splitter group 1 of window "Colors" of application process "Notes"
    	
    	set color1 to value of color well 1 of list 1 of list "favorite swatches" of scroll area 2 of splitter group 1 of window "Colors" of application process "Notes"
    	
    	set color2 to value of color well 2 of list 1 of list "favorite swatches" of scroll area 2 of splitter group 1 of window "Colors" of application process "Notes"
    	
    	
    	if (currentColor = color1) then
    		click color well 2 of list 1 of list "favorite swatches" of scroll area 2 of splitter group 1 of window "Colors" of application process "Notes"
    	else
    		click color well 1 of list 1 of list "favorite swatches" of scroll area 2 of splitter group 1 of window "Colors" of application process "Notes"
    	end if
    	
    	
    	repeat while (exists window "Colors" of application process "Notes")
    		try
    			click menu item "Hide Colors" of menu 1 of menu item "Font" of menu 1 of menu bar item "Format" of menu bar 1 of application process "Notes"
    		end try
    	end repeat
    	
    end tell
    
    1 replies    2022-01-31 12:18:16 +08:00
    keleo030
        1
    keleo030  
       Jan 31, 2022 via iPad
    感谢分享,听上去有点麻烦。用 notes 的人估计也不多,不过我是 notes 的忠实铁粉,配合 applepencil 体验真不错。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6002 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 02:02 · PVG 10:02 · LAX 19:02 · JFK 22:02
    ♥ Do have faith in what you're doing.