我想创建一个使用AppleScript的应用程序来复制系统信息并通过电子邮件发送给自己.我知道要做电子邮件方面,以及如何使电子邮件具有剪贴板中的任何内容.我如何使用AppleScript编码将文本复制到剪贴板?
如果它有帮助,可以通过电子邮件发送给剪贴板中的任何内容:
set a to "uselessdecoy@gmail.com"
tell application "Mail"
tell (make new outgoing message)
set subject to (the clipboard)
set content to "content"
make new to recipient at end of to recipients with properties {address:a}
send
end tell
end tell
Run Code Online (Sandbox Code Playgroud) 如何在AppleScript中打开Finder的新窗口?我正在使用if else语句来打开一个窗口.我尝试了一个Osascript命令,但它给了我一个语法错误.代码如下:
if the button returned of the result is "Sleep" then
tell app "Finder" to go to sleep
if the button returned of the result is "Open Finder" then
osascript -e 'tell application "Finder" to open new window'
else
display dialog current time
end if
Run Code Online (Sandbox Code Playgroud)