我创建了一个工作流程(使用Applescript)从某个网站获取快照(通过Firefox +附加组件"页面保护程序" +热键)。 但我希望将图像传递给另一个流程的下一步工作流程。
下一步该怎么做?
tell application "Firefox"
open location "http://xxx.xxx.xxx"
activate
tell application "System Events"
keystroke "d" using {control down}
-- take snapshot
end tell
delay 2
close every window of application "Firefox"
tell application "System Events"
keystroke return
end tell
end tell
答案 0 :(得分:1)
这很草率,但它确实有效。
在页面保护程序首选项中,将屏幕截图保存到: /用户/标记/文档/双床
main()
on main()
set screenshotFolder to (alias "Mac OS X:Users:Mark:Documents:Twin:")
tell application "Firefox"
activate
open location "http://www.stackoverflow.com"
delay 3
tell application "System Events"
keystroke "d" using {control down}
delay 2
set latestDate to creation date of file 1 of screenshotFolder
repeat with i from 2 to count of (list folder screenshotFolder)
if creation date of file i of screenshotFolder is greater than latestDate then
set latestDate to creation date of file i of screenshotFolder
end if
end repeat
-- The targetFile is what you are looking for
set targetFile to every file of screenshotFolder whose creation date is latestDate
end tell
end tell
end main