Skip to content

Instantly share code, notes, and snippets.

@cloudsben
Last active October 3, 2016 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cloudsben/3767fb1673b5aef35b0afb9e861e7920 to your computer and use it in GitHub Desktop.
Save cloudsben/3767fb1673b5aef35b0afb9e861e7920 to your computer and use it in GitHub Desktop.
URL convert pdf
tell application "Google Chrome"
if not (exists window 1) then reopen
set myBMFolder to bookmark folder "xxx" of bookmark folder "其他书签"
set bmURLs to URL of bookmark items of myBMFolder
repeat with aUrl in bmURLs
tell application "Safari"
tell window 1
open location aUrl
delay 15
tell application "System Events"
tell application "Safari" to activate
tell process "Safari"
click menu item "导出为 PDF…" of menu "文件" of menu bar 1
key code 76
end tell
end tell
end tell
delay 3
close window 1
end tell
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment