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

求助 applescript 语法问题, Chat-GPT 也无法解决

  •  
  •   AlanZ1997 · Jan 16, 2024 · 1836 views
    This topic created in 837 days ago, the information mentioned may be changed or developed.

    这个脚本运行时提示语法错误 accept this_chat 预期是行的结尾等等,却找到标识符。

    using terms from application "Messages"
    	on «event ichthe06» this_message given «class hepr»:this_buddy, «class hect»:this_chat
    		set this_name to the name of this_buddy
    		if the name of this_buddy is in {"张波波"} then
    			set the greeting_name to the first name of this_buddy
    			if the greeting_name is "" then set the greeting_name to this_name
    			accept this_chat
    			if the content of this_message is "hello" then
    				tell application "QuickTime Player"
    					activate
    					new movie recording
    					start document 1
    					set miniaturized of window 1 to true
    					delay 2 -- 延迟 2 秒以确保录制开始
    					tell application "System Events"
    						keystroke "q" using {command down, control down} -- 锁屏
    					end tell
    				end tell
    			end if
    		end if
    	end «event ichthe06»
    end using terms from
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2439 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:51 · PVG 12:51 · LAX 21:51 · JFK 00:51
    ♥ Do have faith in what you're doing.