Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

贡献个mac的applescript脚本,实现自动点击试用按钮 #28

Open
anjia0532 opened this issue Sep 27, 2024 · 8 comments
Open

Comments

@anjia0532
Copy link

anjia0532 commented Sep 27, 2024

先分配权限

chmod 777 ./reset_navicat.sh

property btnTitle : "试用"
try
	set rr to do shell script "./reset_navicat.sh"
end try

tell application "/Applications/Navicat Premium.app" to activate

tell application "System Events"
	tell application process "Navicat Premium"
		click button btnTitle of window 1
		delay 1
	end tell
end tell

保存为 navicat.scptreset_navicat.sh 同目录

osascript navicat.scpt

会提示获取辅助功能权限,去系统里允许就行了。

再次执行

osascript navicat.scpt

@yhan219
Copy link
Owner

yhan219 commented Sep 29, 2024

感觉有点麻烦,我加了个command脚本,试试看

@anjia0532
Copy link
Author

这个脚本主要是为了自动点击试用按钮,跳过人工点击。

@yhan219
Copy link
Owner

yhan219 commented Sep 30, 2024

我这里没运行成功

@anjia0532
Copy link
Author

提示啥呢?需要跟 navicat.scpt 与 reset_navicat.sh 同目录,给 reset_navicat.sh 分配可执行权限,chmod 777 reset_navicat.sh , 在终端cd到该目录,osascript navicat.scpt mac会提示终端申请辅助功能,打开后,再次执行,一般就可以了(需要把navicat进程退出后再点,否则会报错)

@winqihe
Copy link

winqihe commented Oct 7, 2024

先分配权限

chmod 777 ./reset_navicat.sh

property btnTitle : "试用"
try
	set rr to do shell script "./reset_navicat.sh"
end try

tell application "/Applications/Navicat Premium.app" to activate

tell application "System Events"
	tell application process "Navicat Premium"
		click button btnTitle of window 1
		delay 1
	end tell
end tell

保存为 navicat.scptreset_navicat.sh 同目录

osascript navicat.scpt

会提示获取辅助功能权限,去系统里允许就行了。

再次执行

osascript navicat.scpt

截屏2024-10-07 13 48 13

@winqihe
Copy link

winqihe commented Oct 7, 2024

先分配权限

chmod 777 ./reset_navicat.sh

property btnTitle : "试用"
try
	set rr to do shell script "./reset_navicat.sh"
end try

tell application "/Applications/Navicat Premium.app" to activate

tell application "System Events"
	tell application process "Navicat Premium"
		click button btnTitle of window 1
		delay 1
	end tell
end tell

保存为 navicat.scptreset_navicat.sh 同目录

osascript navicat.scpt

会提示获取辅助功能权限,去系统里允许就行了。

再次执行

osascript navicat.scpt

告诉我navicat试用已经结束,而我已经运行脚本并且在安全性隐私中的辅助功能将navicat 添加进去了。

@anjia0532
Copy link
Author

这个脚本很简单,就是模拟鼠标点击
第一步是调用 reset_navicat.sh 重置试用周期。
第二步就是navicat出现试用按钮时,脚本模拟点击。
你既然试用已经结束,那应该是 reset_navicat.sh 本身没重置成功吧?

@huangxinjian
Copy link

大伙的navicat卡顿吗,我的m2 用 navicat perimum 16 感觉好卡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants