1
該腳本應該在新的瀏覽器窗口中打開一系列網頁,然後用預定的文本和鏈接打開TextEdit。
Safari做它應該的。
文本編輯打開並粘貼我想要的文本,但鏈接不可點擊。
我知道我可以右鍵單擊並選擇Substitutions> Add Links>我自己,但我試圖自動化整個過程。
我代表我感謝您的時間和精力!謝謝!如何使TextEdit鏈接可點擊
OpenWebPages()
OpenTextEditPage()
to OpenTextEditPage()
-- Create a variable for text
set docText to ""
tell application "TextEdit"
activate
make new document
-- Define the text to be pasted into TextEdit
set docText to docText & "Some text to show in TextEdit." & linefeed & "
My favorite site about coding is http://stackoverflow.com/
My favorite site for paper modeling is http://www.ss42.com/toys.html
My favorite site for inventing is http://www.instructables.com/howto/bubble+machine/
" & linefeed & "Click the links above to improve your mind!" as string
-- Past the above text and links into TextEdit
set the text of the front document to docText & "" as string
tell application "System Events"
tell process "TextEdit"
-- highlight all text
keystroke "a" using command down
-- Think of a clever way to right click and choose Substitutions> Add Links>
-- Or think of another clever way to turn all URLs into links please.
end tell
end tell
end tell
end OpenTextEditPage
to OpenWebPages()
-- Start new Safari window
tell application "Safari"
-- activate Safari and open the StackOverflow AppleScript page
make new document with properties {URL:"http://stackoverflow.com/search?q=applescript"}
-- Yoda is watching you
open location "http://www.ss42.com/pt/Yoda/YodaGallery/yoda-gallery.html"
-- Indoor boomerang
open location "http://www.ss42.com/pt/paperang/paperang.html"
-- Are you a Human ?
open location "http://stackoverflow.com/nocaptcha?s=f5c92674-b080-4cea-9ff2-4fdf1d6d19de"
end tell
end OpenWebPages
我都試過了,但我就是不明白這個答案。 也許我應該指定我正在尋找AppleScript解決方案。我對shell腳本知之甚少,所以我不知道如何處理這個腳本來處理腳本。 儘管感謝您的幫助! – Frankenpaper
我不想提及TextEdit永遠不是保存的文件。它是爲這一次使用而創建的,一旦用戶達到目的,它將被用戶關閉。 – Frankenpaper