twitter投稿用
#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "Foundation"
use scripting additions
property refMe : a reference to current application
tell application "Google Chrome"
activate
tell window 1
tell active tab
set strCurrentTabUrl to URL as text
set strCurrentTabTitle to title as text
end tell
end tell
end tell
set strBaseUrl to "https://twitter.com/intent/tweet?"
set strCurrentTabTitle to ("\n--\n" & strCurrentTabTitle) as text
set strCurrentTabUrl to doUrlEncode(strCurrentTabUrl) as text
set strCurrentTabTitle to doUrlEncode(strCurrentTabTitle) as text
set strOpenUrl to ("" & strBaseUrl & "url=" & strCurrentTabUrl & "&text=" & strCurrentTabTitle & "") as text
tell application "Google Chrome"
activate
tell window 1
set objNewTab to make new tab
tell objNewTab to set URL to strOpenUrl
end tell
end tell
on doUrlEncode(argString)
set ocidStrings to refMe's NSString's stringWithString:(argString)
set ocidCharacterSet to refMe's NSCharacterSet's URLPathAllowedCharacterSet()
set ocidEncodedURL to ocidStrings's stringByAddingPercentEncodingWithAllowedCharacters:ocidCharacterSet
set strEncodedURL to ocidEncodedURL as text
return strEncodedURL as text
end doUrlEncode
| 固定リンク
「Twitter」カテゴリの記事
- twitter用画像生成 9種類の画像の合成(2024.08.06)
- twitter投稿用画像3分割(仮)(2024.04.11)
- twitter投稿用画像4分割(2024.04.07)
- [com.microsoft.edgemac]前面のページのURLをtwitter.comに引用投稿(2024.02.28)
- twitter投稿用(2023.05.01)