AppleScript NSURLComponents

URLにクエリーを追加


【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use scripting additions
property refMe : a reference to current application

### 【1】RSSのURL
#基本となるURL
set strURL to ("https://mac.softpedia.com/backend.xml") as text
#NSURLにして
set ocidBaseURL to refMe's NSURL's alloc()'s initWithString:(strURL)
#コンポーネントに分割
set ocidURLomponents to refMe's NSURLComponents's componentsWithURL:(ocidBaseURL) resolvingAgainstBaseURL:(false)
#クエリーアイテム
set ocidQueryItems to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
#クエリー定義
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("") value:("_all")
#クエリーをセット
ocidQueryItems's addObject:(ocidQueryItem)
#コンポーネントに追加
ocidURLomponents's setQueryItems:(ocidQueryItems)
#URLを再定義
set ocidURL to ocidURLomponents's |URL|
#ホスト
set strHost to ocidURL's |host|() as text

|

[FaceTime]電話をかける


【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application


########################
## クリップボードの中身取り出し
########################
##クリップボードにテキストが無い場合
set strMes to ("電話番号を入力してください") as text
###初期化
set ocidPasteboard to refMe's NSPasteboard's generalPasteboard()
set ocidPastBoardTypeArray to ocidPasteboard's types
###テキストがあれば
set boolContain to ocidPastBoardTypeArray's containsObject:"public.utf8-plain-text"
if boolContain = true then
  ###値を格納する
  tell application "Finder"
    set strDefaultAnswer to (the clipboard as text) as text
  end tell
  ###Finderでエラーしたら
else
  set boolContain to ocidPastBoardTypeArray's containsObject:"NSStringPboardType"
  if boolContain = true then
    set ocidReadString to ocidPasteboard's readObjectsForClasses:({refMe's NSString}) options:(missing value)
    set strDefaultAnswer to ocidReadString as text
  else
    log "テキストなし"
    set strDefaultAnswer to strMes as text
  end if
end if
##############################
#####ダイアログ
##############################
##前面に出す
set strName to (name of current application) as text
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
###アイコンパス
set aliasIconPath to POSIX file "/System/Applications/Calculator.app/Contents/Resources/AppIcon.icns" as alias
try
  set recordResult to (display dialog strMes with title "入力してください" default answer strDefaultAnswer buttons {"OK", "キャンセル"} default button "OK" with icon aliasIconPath giving up after 30 without hidden answer) as record
on error
  log "エラーしました"
return "キャンセル"
end try

if "OK" is equal to (button returned of recordResult) then
  set strReturnedText to (text returned of recordResult) as text
else if (gave up of recordResult) is true then
return "時間切れです"
else
return "キャンセル"
end if

##############################
#####本処理
##############################
###NSStringに格納
set ocidResponseText to (refMe's NSString's stringWithString:(strReturnedText))
###タブと改行を除去しておく
set ocidTextM to refMe's NSMutableString's alloc()'s initWithCapacity:(0)
ocidTextM's appendString:(ocidResponseText)
##改行除去
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("\n") withString:("")
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("\r") withString:("")
##タブ除去
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("\t") withString:("")
##半角
set ocidNSStringTransform to (refMe's NSStringTransformFullwidthToHalfwidth)
set ocidTextM to (ocidTextM's stringByApplyingTransform:(ocidNSStringTransform) |reverse|:false)
##ハイフン除去
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("-") withString:("")
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("−") withString:("")
###########################
###URL整形
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
###スキーム を追加
ocidURLComponents's setScheme:("tel")
###パスを追加(setHostじゃないよ)
ocidURLComponents's setPath:(ocidTextM)
##URLに戻して テキストにしておく
set ocidOpenURL to ocidURLComponents's |URL|()
set strOpenURL to ocidOpenURL's absoluteString() as text
###########################
### OPEN URL
set appShardWorkspace to refMe's NSWorkspace's sharedWorkspace()
set boolDone to appShardWorkspace's openURL:(ocidOpenURL)

return

tell application id "com.apple.FaceTime"
  open location strOpenURL
end tell
(*
##別なアプリを指定している場合
tell application "Finder"
open location strOpenURL
end tell
*)


|

[NSURLComponents] まとめ

【1】http
[NSURLComponents] http系の基本処理見本
https://quicktimer.cocolog-nifty.com/icefloe/2023/11/post-1601f5.html

【2】mailto
[NSURL] eMailのNSURL
https://quicktimer.cocolog-nifty.com/icefloe/2023/06/post-992871.html
[NSURLComponents]mailto:のURLの扱いについて
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-b15d5f.html

【3】他
x-apple-findertag
[x-apple-findertag]タグのNSURL
https://quicktimer.cocolog-nifty.com/icefloe/2023/06/post-271bd5.html

macappstore
[AppStore]アップデートページを開く
https://quicktimer.cocolog-nifty.com/icefloe/2023/10/post-a25cd6.html

x-apple.systempreferences
システム設定をオープンさせるスクリプトの作成補助v3
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-af2f58.html

edge
https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-cca752.html

chrome
https://quicktimer.cocolog-nifty.com/icefloe/2023/08/post-55cc93.html

【基本】
[NSURLComponents] initWithString
https://quicktimer.cocolog-nifty.com/icefloe/2022/09/post-1f5451.html
[queryItems]クエリーの各アイテムの値を取得
https://quicktimer.cocolog-nifty.com/icefloe/2023/02/post-e4218d.html

|

URLからクエリーを削除する


【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application


###元になるURL
set strURL to ("https://hoge.domain.com/some/dir/some/file.exe?q=someQuery")
set ocidURL to refMe's NSURL's URLWithString:(strURL)
log ocidURL's absoluteString() as text
(*https://hoge.domain.com/some/dir/some/file.exe?q=someQuery*)

##クエリー部取り出し
set ocidQuery to ocidURL's query()
log ocidQuery as text
(*q=someQuery*)

##NSURLComponents クエリーを削除 クエリーがなくなるので?がない
set ocidURLComponents to refMe's NSURLComponents's componentsWithURL:(ocidURL) resolvingAgainstBaseURL:(false)
##クエリーにNULL=クエリー削除=missing value
ocidURLComponents's setQuery:(missing value)
set ocidURL to ocidURLComponents's |URL|()
log ocidURL's absoluteString() as text
(*https://hoge.domain.com/some/dir/some/file.exe*)

##NSURLComponents 空のクエリーをセット ?が残る
set ocidURLComponents to refMe's NSURLComponents's componentsWithURL:(ocidURL) resolvingAgainstBaseURL:(false)
##クエリーにNULL=クエリー削除
ocidURLComponents's setQuery:("")
set ocidURL to ocidURLComponents's |URL|()
log ocidURL's absoluteString() as text
(*https://hoge.domain.com/some/dir/some/file.exe?*)


|

[NSURLComponents] http系の基本処理見本


【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application


###########################
###URL整形
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
###スキーム を追加
ocidURLComponents's setScheme:("https")
###ホスト追加
ocidURLComponents's setHost:("acrobat.adobe.com")
###パスを追加(setHostじゃないよ)
ocidURLComponents's setPath:("/link/file")
##クエリー部
set ocidQueryItems to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
##ファイルタイプ クエリー1
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("filetype") value:("application/pdf")
ocidQueryItems's addObject:(ocidQueryItem)
##アセットID クエリー2
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("uri") value:("someID")
ocidQueryItems's addObject:(ocidQueryItem)
##クエリーをセットする
ocidURLComponents's setQueryItems:(ocidQueryItems)
##URLに戻して テキストにしておく
set ocidOpenURL to ocidURLComponents's |URL|()
set strOpenURL to ocidOpenURL's absoluteString() as text

|

[twitter]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.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application
########################
###設定項目
########################
###自分のID
set strMyTwiiterID to ("floe_ice") as text
###開くアプリケーション
set strBundleID to "com.microsoft.edgemac" as text
(* ここは好みで変更
com.apple.Safari
com.google.Chrome
org.mozilla.firefox
*)
########################
## クリップボードの中身取り出し
########################
###初期化
set ocidPasteboard to refMe's NSPasteboard's generalPasteboard()
set ocidPastBoardTypeArray to ocidPasteboard's types
###テキストがあれば
set boolContain to ocidPastBoardTypeArray's containsObject:"public.utf8-plain-text"
if boolContain = true then
  ###値を格納する
  tell application "Finder"
    set strReadString to (the clipboard as text) as text
  end tell
  ###Finderでエラーしたら
else
  set boolContain to ocidPastBoardTypeArray's containsObject:"NSStringPboardType"
  if boolContain = true then
    set ocidReadString to ocidPasteboard's readObjectsForClasses:({refMe's NSString}) options:(missing value)
    set strReadString to ocidReadString as text
  else
    log "テキストなし"
    set strReadString to "検索文字列を入力" as text
  end if
end if
##############################
#####ダイアログ
##############################
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder"
    activate
  end tell
else
  tell current application
    activate
  end tell
end if
set aliasIconPath to (POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/MagnifyingGlassIcon.icns") as alias
try
  
  set strMes to "検索文字列を入力してください\nユーザー指定:@" & strMyTwiiterID & "でtwitter検索します" as text
  
  set recordResult to (display dialog strMes with title "入力してください" default answer strReadString buttons {"OK", "キャンセル"} default button "OK" with icon aliasIconPath giving up after 10 without hidden answer) as record
on error
  log "エラーしました"
return
end try

if "OK" is equal to (button returned of recordResult) then
  set strReturnedText to (text returned of recordResult) as text
else if (gave up of recordResult) is true then
return "時間切れです"
else
return "キャンセル"
end if


################################
## 本処理
################################
set ocidResponseText to (refMe's NSString's stringWithString:(strReturnedText))
###タブと改行を除去しておく
set ocidTextM to refMe's NSMutableString's alloc()'s initWithCapacity:(0)
ocidTextM's appendString:(ocidResponseText)
##改行除去
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("\n") withString:("")
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("\r") withString:("")
##タブ除去
set ocidTextM to ocidTextM's stringByReplacingOccurrencesOfString:("\t") withString:("")
set strReturnedText to ocidTextM as text
##検索文字列にする
set strSearchString to ("@" & strMyTwiiterID & " " & strReturnedText) as text
##@を%エンコードしたいならこちら
## set strSearchString to ("%40" & strMyTwiiterID & " " & strReturnedText) as text
set ocidViewURLString to refMe's NSString's stringWithString:(strSearchString)
##クエリーアイテムにしておく
set ocidQueryItemQ to refMe's NSURLQueryItem's alloc()'s initWithName:("q") value:(ocidViewURLString)
##クエリーアイテム『ズ』でセットするのArrayに入れておく
set ocidQueryItems to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
ocidQueryItems's addObject:(ocidQueryItemQ)
##TOPの場合
#set ocidQueryItemF to refMe's NSURLQueryItem's alloc()'s initWithName:("f") value:("top")
##Latestの場合
set ocidQueryItemF to refMe's NSURLQueryItem's alloc()'s initWithName:("f") value:("live")
ocidQueryItems's addObject:(ocidQueryItemF)
##
set ocidQueryItemSRC to refMe's NSURLQueryItem's alloc()'s initWithName:("src") value:("typed_query")
ocidQueryItems's addObject:(ocidQueryItemSRC)


##############
###送信するURL
set strURL to ("https://twitter.com/search") as text
set ocidURL to refMe's NSURL's URLWithString:(strURL)
###コンポーネントに分解
set ocidComponents to refMe's NSURLComponents's alloc()'s initWithURL:(ocidURL) resolvingAgainstBaseURL:(true)
##クエリーをセットする
ocidComponents's setQueryItems:(ocidQueryItems)
##URLに戻して テキストにしておく
set ocidOpenURL to ocidComponents's |URL|()
set strOpenURL to ocidOpenURL's absoluteString() as text

################################
## OPEN
################################
tell application id strBundleID
  open location strOpenURL
end tell

####################################
###### %エンコード
####################################
on doUrlEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ##テキスト形式に確定
  set strTextToEncode to ocidArgTextEncoded as text
  ###値を戻す
return strTextToEncode
end doUrlEncode
####################################
###### %エンコード
####################################
on doTextEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ######## 置換 %エンコードの追加処理
  ###置換レコード
  set recordPercentMap to {|!|:"%21", |#|:"%23", |$|:"%24", |&|:"%26", |'|:"%27", |(|:"%28", |)|:"%29", |*|:"%2A", |+|:"%2B", |,|:"%2C", |:|:"%3A", |;|:"%3B", |=|:"%3D", |?|:"%3F", |@|:"%40", | |:"%20", |/|:"%2F"} as record
  ###ディクショナリにして
  set ocidPercentMap to refMe's NSDictionary's alloc()'s initWithDictionary:(recordPercentMap)
  ###キーの一覧を取り出します
  set ocidAllKeys to ocidPercentMap's allKeys()
  ###取り出したキー一覧を順番に処理
  repeat with itemAllKey in ocidAllKeys
    set strItemKey to itemAllKey as text
    ##キーの値を取り出して
    if strItemKey is "@" then
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:("@") withString:("%40"))
    else
      set ocidMapValue to (ocidPercentMap's valueForKey:(strItemKey))
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:(strItemKey) withString:(ocidMapValue))
    end if
    ##次の変換に備える
    set ocidArgTextEncoded to ocidEncodedText
  end repeat
  ##テキスト形式に確定
  set strTextToEncode to ocidEncodedText as text
  ###値を戻す
return strTextToEncode
end doTextEncode
####################################
###### %デコード
####################################
on doUrlDecode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##デコード
  set ocidArgTextEncoded to ocidArgText's stringByRemovingPercentEncoding
  set strArgTextEncoded to ocidArgTextEncoded as text
return strArgTextEncoded
end doUrlDecode

|

[pagespeed.web.dev]前面ページをpagespeed.web.devに送る

Safari

【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application


set strBundleID to "com.apple.Safari" as text


###全面のタブのURLを取得して
tell application "Safari"
  set numCntWindow to (count of every window) as integer
  if numCntWindow = 0 then
return "ウィンドウがありません"
  end if
end tell
tell application "Safari"
  set numID to id of front window
  set objTab to current tab of window id numID
  
  tell window id numID
    tell objTab
      set strViewURL to URL as text
    end tell
  end tell
end tell
##############
###
if strViewURL is (missing value) then
return "ページを開いていません"
end if

################################
## 本処理
################################
###表示中のURLを%エンコード-->不要でした
##set strEncURL to doTextEncode(strViewURL)
set ocidViewURLString to refMe's NSString's stringWithString:(strViewURL)
##クエリーアイテムにしておく
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("url") value:(ocidViewURLString)
##クエリーアイテム『ズ』でセットするのArrayに入れておく
set ocidQueryItems to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
ocidQueryItems's addObject:(ocidQueryItem)
##############
###送信するURL
set strURL to ("https://pagespeed.web.dev/analysis") as text
set ocidURL to refMe's NSURL's URLWithString:(strURL)
###コンポーネントに分解
set ocidComponents to refMe's NSURLComponents's alloc()'s initWithURL:(ocidURL) resolvingAgainstBaseURL:(true)
##クエリーをセットする
ocidComponents's setQueryItems:(ocidQueryItems)
##URLに戻して テキストにしておく
set ocidOpenURL to ocidComponents's |URL|()
set strOpenURL to ocidOpenURL's absoluteString() as text

################################
## OPEN
################################
tell application id strBundleID
  open location strOpenURL
end tell

####################################
###### %エンコード
####################################
on doUrlEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ##テキスト形式に確定
  set strTextToEncode to ocidArgTextEncoded as text
  ###値を戻す
return strTextToEncode
end doUrlEncode
####################################
###### %エンコード
####################################
on doTextEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ######## 置換 %エンコードの追加処理
  ###置換レコード
  set recordPercentMap to {|!|:"%21", |#|:"%23", |$|:"%24", |&|:"%26", |'|:"%27", |(|:"%28", |)|:"%29", |*|:"%2A", |+|:"%2B", |,|:"%2C", |:|:"%3A", |;|:"%3B", |=|:"%3D", |?|:"%3F", |@|:"%40", | |:"%20", |/|:"%2F"} as record
  ###ディクショナリにして
  set ocidPercentMap to refMe's NSDictionary's alloc()'s initWithDictionary:(recordPercentMap)
  ###キーの一覧を取り出します
  set ocidAllKeys to ocidPercentMap's allKeys()
  ###取り出したキー一覧を順番に処理
  repeat with itemAllKey in ocidAllKeys
    set strItemKey to itemAllKey as text
    ##キーの値を取り出して
    if strItemKey is "@" then
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:("@") withString:("%40"))
    else
      set ocidMapValue to (ocidPercentMap's valueForKey:(strItemKey))
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:(strItemKey) withString:(ocidMapValue))
    end if
    ##次の変換に備える
    set ocidArgTextEncoded to ocidEncodedText
  end repeat
  ##テキスト形式に確定
  set strTextToEncode to ocidEncodedText as text
  ###値を戻す
return strTextToEncode
end doTextEncode
####################################
###### %デコード
####################################
on doUrlDecode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##デコード
  set ocidArgTextEncoded to ocidArgText's stringByRemovingPercentEncoding
  set strArgTextEncoded to ocidArgTextEncoded as text
return strArgTextEncoded
end doUrlDecode

com.google.Chrome

【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application


set strBundleID to "com.google.Chrome" as text


###全面のタブのURLを取得して
tell application "Google Chrome"
  tell front window
    tell active tab
      set strViewURL to URL as text
    end tell
  end tell
end tell
##############
###
if strViewURL is (missing value) then
return "ページを開いていません"
end if

################################
## 本処理
################################
###表示中のURLを%エンコード-->不要でした
##set strEncURL to doTextEncode(strViewURL)
set ocidViewURLString to refMe's NSString's stringWithString:(strViewURL)
##クエリーアイテムにしておく
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("url") value:(ocidViewURLString)
##クエリーアイテム『ズ』でセットするのArrayに入れておく
set ocidQueryItems to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
ocidQueryItems's addObject:(ocidQueryItem)
##############
###送信するURL
set strURL to ("https://pagespeed.web.dev/analysis") as text
set ocidURL to refMe's NSURL's URLWithString:(strURL)
###コンポーネントに分解
set ocidComponents to refMe's NSURLComponents's alloc()'s initWithURL:(ocidURL) resolvingAgainstBaseURL:(true)
##クエリーをセットする
ocidComponents's setQueryItems:(ocidQueryItems)
##URLに戻して テキストにしておく
set ocidOpenURL to ocidComponents's |URL|()
set strOpenURL to ocidOpenURL's absoluteString() as text

################################
## OPEN
################################
tell application id strBundleID
  open location strOpenURL
end tell

####################################
###### %エンコード
####################################
on doUrlEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ##テキスト形式に確定
  set strTextToEncode to ocidArgTextEncoded as text
  ###値を戻す
return strTextToEncode
end doUrlEncode
####################################
###### %エンコード
####################################
on doTextEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ######## 置換 %エンコードの追加処理
  ###置換レコード
  set recordPercentMap to {|!|:"%21", |#|:"%23", |$|:"%24", |&|:"%26", |'|:"%27", |(|:"%28", |)|:"%29", |*|:"%2A", |+|:"%2B", |,|:"%2C", |:|:"%3A", |;|:"%3B", |=|:"%3D", |?|:"%3F", |@|:"%40", | |:"%20", |/|:"%2F"} as record
  ###ディクショナリにして
  set ocidPercentMap to refMe's NSDictionary's alloc()'s initWithDictionary:(recordPercentMap)
  ###キーの一覧を取り出します
  set ocidAllKeys to ocidPercentMap's allKeys()
  ###取り出したキー一覧を順番に処理
  repeat with itemAllKey in ocidAllKeys
    set strItemKey to itemAllKey as text
    ##キーの値を取り出して
    if strItemKey is "@" then
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:("@") withString:("%40"))
    else
      set ocidMapValue to (ocidPercentMap's valueForKey:(strItemKey))
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:(strItemKey) withString:(ocidMapValue))
    end if
    ##次の変換に備える
    set ocidArgTextEncoded to ocidEncodedText
  end repeat
  ##テキスト形式に確定
  set strTextToEncode to ocidEncodedText as text
  ###値を戻す
return strTextToEncode
end doTextEncode
####################################
###### %デコード
####################################
on doUrlDecode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##デコード
  set ocidArgTextEncoded to ocidArgText's stringByRemovingPercentEncoding
  set strArgTextEncoded to ocidArgTextEncoded as text
return strArgTextEncoded
end doUrlDecode

org.mozilla.firefox

【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application


set strBundleID to "org.mozilla.firefox" as text


###全面のタブのURLを取得して
####ページ情報を開く
tell application "Firefox"
  tell front window
    activate
    tell application "System Events"
      tell process "Firefox"
keystroke "i" using {command down}
      end tell
    end tell
  end tell
end tell

delay 1


#####ページ情報の名称を取得
tell application "Firefox"
  tell window 1
    set strPageName to name as text
  end tell
end tell


####ページ情報を閉じる
tell application "Firefox"
  tell window 1
close
  end tell
end tell



set strViewURL to doReplace(strPageName, "ページ情報 — ", "")
##############
###
if strViewURL is (missing value) then
return "ページを開いていません"
end if

################################
## 本処理
################################
###表示中のURLを%エンコード-->不要でした
##set strEncURL to doTextEncode(strViewURL)
set ocidViewURLString to refMe's NSString's stringWithString:(strViewURL)
##クエリーアイテムにしておく
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("url") value:(ocidViewURLString)
##クエリーアイテム『ズ』でセットするのArrayに入れておく
set ocidQueryItems to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
ocidQueryItems's addObject:(ocidQueryItem)
##############
###送信するURL
set strURL to ("https://pagespeed.web.dev/analysis") as text
set ocidURL to refMe's NSURL's URLWithString:(strURL)
###コンポーネントに分解
set ocidComponents to refMe's NSURLComponents's alloc()'s initWithURL:(ocidURL) resolvingAgainstBaseURL:(true)
##クエリーをセットする
ocidComponents's setQueryItems:(ocidQueryItems)
##URLに戻して テキストにしておく
set ocidOpenURL to ocidComponents's |URL|()
set strOpenURL to ocidOpenURL's absoluteString() as text

################################
## OPEN
################################
tell application id strBundleID
  open location strOpenURL
end tell

####################################
###### %エンコード
####################################
on doUrlEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ##テキスト形式に確定
  set strTextToEncode to ocidArgTextEncoded as text
  ###値を戻す
return strTextToEncode
end doUrlEncode
####################################
###### %エンコード
####################################
on doTextEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ######## 置換 %エンコードの追加処理
  ###置換レコード
  set recordPercentMap to {|!|:"%21", |#|:"%23", |$|:"%24", |&|:"%26", |'|:"%27", |(|:"%28", |)|:"%29", |*|:"%2A", |+|:"%2B", |,|:"%2C", |:|:"%3A", |;|:"%3B", |=|:"%3D", |?|:"%3F", |@|:"%40", | |:"%20", |/|:"%2F"} as record
  ###ディクショナリにして
  set ocidPercentMap to refMe's NSDictionary's alloc()'s initWithDictionary:(recordPercentMap)
  ###キーの一覧を取り出します
  set ocidAllKeys to ocidPercentMap's allKeys()
  ###取り出したキー一覧を順番に処理
  repeat with itemAllKey in ocidAllKeys
    set strItemKey to itemAllKey as text
    ##キーの値を取り出して
    if strItemKey is "@" then
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:("@") withString:("%40"))
    else
      set ocidMapValue to (ocidPercentMap's valueForKey:(strItemKey))
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:(strItemKey) withString:(ocidMapValue))
    end if
    ##次の変換に備える
    set ocidArgTextEncoded to ocidEncodedText
  end repeat
  ##テキスト形式に確定
  set strTextToEncode to ocidEncodedText as text
  ###値を戻す
return strTextToEncode
end doTextEncode
####################################
###### %デコード
####################################
on doUrlDecode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##デコード
  set ocidArgTextEncoded to ocidArgText's stringByRemovingPercentEncoding
  set strArgTextEncoded to ocidArgTextEncoded as text
return strArgTextEncoded
end doUrlDecode

####################################
###### 文字の置換
####################################
to doReplace(theText, orgStr, newStr)
  set oldDelim to AppleScript's text item delimiters
  set AppleScript's text item delimiters to orgStr
  set tmpList to every text item of theText
  set AppleScript's text item delimiters to newStr
  set tmpStr to tmpList as text
  set AppleScript's text item delimiters to oldDelim
return tmpStr
end doReplace


com.microsoft.edgemac

【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use framework "UniformTypeIdentifiers"
use framework "AppKit"
use scripting additions
property refMe : a reference to current application


set strBundleID to "com.microsoft.edgemac" as text


###全面のタブのURLを取得して
tell application "Microsoft Edge"
  tell front window
    tell active tab
      set strViewURL to URL as text
    end tell
  end tell
end tell
##############
###
if strViewURL is (missing value) then
return "ページを開いていません"
end if

################################
## 本処理
################################
###表示中のURLを%エンコード-->不要でした
##set strEncURL to doTextEncode(strViewURL)
set ocidViewURLString to refMe's NSString's stringWithString:(strViewURL)
##クエリーアイテムにしておく
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("url") value:(ocidViewURLString)
##クエリーアイテム『ズ』でセットするのArrayに入れておく
set ocidQueryItems to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
ocidQueryItems's addObject:(ocidQueryItem)
##############
###送信するURL
set strURL to ("https://pagespeed.web.dev/analysis") as text
set ocidURL to refMe's NSURL's URLWithString:(strURL)
###コンポーネントに分解
set ocidComponents to refMe's NSURLComponents's alloc()'s initWithURL:(ocidURL) resolvingAgainstBaseURL:(true)
##クエリーをセットする
ocidComponents's setQueryItems:(ocidQueryItems)
##URLに戻して テキストにしておく
set ocidOpenURL to ocidComponents's |URL|()
set strOpenURL to ocidOpenURL's absoluteString() as text

################################
## OPEN
################################
tell application id strBundleID
  open location strOpenURL
end tell

####################################
###### %エンコード
####################################
on doUrlEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ##テキスト形式に確定
  set strTextToEncode to ocidArgTextEncoded as text
  ###値を戻す
return strTextToEncode
end doUrlEncode
####################################
###### %エンコード
####################################
on doTextEncode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##キャラクタセットを指定
  set ocidChrSet to refMe's NSCharacterSet's URLQueryAllowedCharacterSet
  ##キャラクタセットで変換
  set ocidArgTextEncoded to ocidArgText's stringByAddingPercentEncodingWithAllowedCharacters:(ocidChrSet)
  ######## 置換 %エンコードの追加処理
  ###置換レコード
  set recordPercentMap to {|!|:"%21", |#|:"%23", |$|:"%24", |&|:"%26", |'|:"%27", |(|:"%28", |)|:"%29", |*|:"%2A", |+|:"%2B", |,|:"%2C", |:|:"%3A", |;|:"%3B", |=|:"%3D", |?|:"%3F", |@|:"%40", | |:"%20", |/|:"%2F"} as record
  ###ディクショナリにして
  set ocidPercentMap to refMe's NSDictionary's alloc()'s initWithDictionary:(recordPercentMap)
  ###キーの一覧を取り出します
  set ocidAllKeys to ocidPercentMap's allKeys()
  ###取り出したキー一覧を順番に処理
  repeat with itemAllKey in ocidAllKeys
    set strItemKey to itemAllKey as text
    ##キーの値を取り出して
    if strItemKey is "@" then
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:("@") withString:("%40"))
    else
      set ocidMapValue to (ocidPercentMap's valueForKey:(strItemKey))
      ##置換
      set ocidEncodedText to (ocidArgTextEncoded's stringByReplacingOccurrencesOfString:(strItemKey) withString:(ocidMapValue))
    end if
    ##次の変換に備える
    set ocidArgTextEncoded to ocidEncodedText
  end repeat
  ##テキスト形式に確定
  set strTextToEncode to ocidEncodedText as text
  ###値を戻す
return strTextToEncode
end doTextEncode
####################################
###### %デコード
####################################
on doUrlDecode(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##デコード
  set ocidArgTextEncoded to ocidArgText's stringByRemovingPercentEncoding
  set strArgTextEncoded to ocidArgTextEncoded as text
return strArgTextEncoded
end doUrlDecode

|

[NSURLComponents]mailto:のURLの扱いについて(Emailアドレスを取り出すにはコンポーネントに分割してから)


【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application

set strURL to "mailto:foo@hoge.com?subject=Hi" as text
set ocidURL to refMe's NSURL's alloc()'s initWithString:(strURL)

log ocidURL's absoluteString() as text
-->(*mailto:foo@hoge.com?subject=Hi*)
log ocidURL's |scheme|() as text
-->(*mailto*)
log ocidURL's |path|() as text
-->(*missing value*)
log ocidURL's query() as text
-->(*missing value*)
###Emailアドレスを取り出すにはコンポーネントに分割してから
set ocidComponent to refMe's NSURLComponents's componentsWithURL:(ocidURL) resolvingAgainstBaseURL:(false)
log ocidComponent's |path|() as text
-->(*foo@hoge.com*)
log ocidComponent's query() as text
-->(*subject=Hi*)



|

[x-apple-findertag]タグのNSURL


【スクリプトエディタで開く】|

#!/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.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

set itemTagName to "レッド"
###コンポーネント初期化
set ocidURLComponents to refMe's NSURLComponents's alloc()'s init()
###スキーム を追加
ocidURLComponents's setScheme:("x-apple-findertag")
###パスを追加(setHostじゃないよ)
ocidURLComponents's setPath:(itemTagName)
set ocidTagURL to ocidURLComponents's |URL|
log ocidTagURL's absoluteString() as text
-->(*x-apple-findertag:%E3%83%AC%E3%83%83%E3%83%89*)

|

[NSURL] eMailのNSURL


【スクリプトエディタで開く】|

#!/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

###コンポーネント初期化
set ocidComponents to refMe's NSURLComponents's alloc()'s init()
###スキーム mailtoを追加
ocidComponents's setScheme:("mailto")
###パスを追加(setHostじゃないよ)
ocidComponents's setPath:("foo@mail.hoge.com")
###URLに
set ocidEmailURL to ocidComponents's |URL|
log ocidEmailURL's absoluteString() as text
-->(*mailto:foo@mail.hoge.com*)


【スクリプトエディタで開く】|

#!/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

###コンポーネント初期化
set ocidEmailComponents to refMe's NSURLComponents's alloc()'s init()
###スキーム mailtoを追加
ocidEmailComponents's setScheme:("mailto" )
###パスを追加(setHostじゃないよ)
ocidEmailComponents's setPath:("foo@hoge.com" )
###クエリー追加
set ocidQueryItemArray to refMe's NSMutableArray's alloc()'s initWithCapacity:0
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("subject") value:("【件名】よろしくお願いします")
ocidQueryItemArray's addObject:ocidQueryItem
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("body") value:("お世話になります")
ocidQueryItemArray's addObject:ocidQueryItem
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("cc") value:("cc@mail.foo.hoge.com")
ocidQueryItemArray's addObject:ocidQueryItem
set ocidQueryItem to refMe's NSURLQueryItem's alloc()'s initWithName:("bcc") value:("bcc@mail.foo.hoge.com")
ocidQueryItemArray's addObject:ocidQueryItem
ocidEmailComponents's setQueryItems:(ocidQueryItemArray)
###URLに
set ocidEmailURL to ocidEmailComponents's |URL|
log ocidEmailURL's absoluteString() as text


|

その他のカテゴリー

Acrobat Acrobat Annotation Acrobat Dialog Acrobat Form Acrobat JS Acrobat Open Acrobat Plugin Acrobat python Acrobat Reader Acrobat Sequ Acrobat Stamps Admin Admin Account Admin Apachectl Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Permission Admin Pkg Admin Power Management Admin Printer Admin SetUp Admin SMB Admin System Information Admin Tools Admin Users Admin Volumes Adobe Apple AppleScript AppleScript Guide AppleScript Accessibility AppleScript AppKit AppleScript Applications AppleScript AppStore AppleScript Archive AppleScript Attributes AppleScript Automator AppleScript AVAsset AppleScript AVconvert AppleScript AVFoundation AppleScript AVURLAsset AppleScript BackUp AppleScript Barcode AppleScript Bash AppleScript Basic AppleScript Basic Path AppleScript Bluetooth AppleScript BOX AppleScript Browser AppleScript Calendar AppleScript CD/DVD AppleScript Choose AppleScript Chrome AppleScript CIImage AppleScript CloudStorage AppleScript Color AppleScript com.apple.LaunchServices.OpenWith AppleScript Console AppleScript Contacts AppleScript CotEditor AppleScript CURL AppleScript current application AppleScript Date&Time AppleScript delimiters AppleScript Desktop AppleScript Device AppleScript Disk AppleScript do shell script AppleScript Dock AppleScript DropBox AppleScript eMail AppleScript Encode Decode AppleScript Error AppleScript EXIFData AppleScript ffmpeg AppleScript File AppleScript Finder AppleScript Firefox AppleScript Folder AppleScript Fonts AppleScript GIF AppleScript HTML AppleScript Icon AppleScript Illustrator AppleScript Image Events AppleScript Image2PDF AppleScript ImageOptim Applescript iWork AppleScript Javascript AppleScript Jedit AppleScript Json AppleScript Label AppleScript List AppleScript locationd AppleScript LRC AppleScript LSSharedFileList AppleScript m3u8 AppleScript MakePDF AppleScript Map AppleScript Math AppleScript Microsoft AppleScript Microsoft Edge AppleScript Microsoft Excel AppleScript Mobileconfig AppleScript Mouse AppleScript Movie AppleScript Music AppleScript NetWork AppleScript Notes AppleScript NSArray AppleScript NSBitmapImageRep AppleScript NSBundle AppleScript NSCFBoolean AppleScript NSCharacterSet AppleScript NSColor AppleScript NSColorList AppleScript NSData AppleScript NSDictionary AppleScript NSError AppleScript NSEvent AppleScript NSFileAttributes AppleScript NSFileManager AppleScript NSFont AppleScript NSFontManager AppleScript NSImage AppleScript NSIndex AppleScript NSKeyedArchiver AppleScript NSKeyedUnarchiver AppleScript NSLocale AppleScript NSMutableArray AppleScript NSMutableDictionary AppleScript NSMutableString AppleScript NSNotFound AppleScript NSNumber AppleScript NSOpenPanel AppleScript NSPasteboard AppleScript NSPDFImageRep AppleScript NSpoint AppleScript NSPredicate AppleScript NSRange AppleScript NSRegularExpression AppleScript NSRunningApplication AppleScript NSScreen AppleScript NSSize AppleScript NSString AppleScript NSStringCompareOptions AppleScript NSTask AppleScript NSTimeZone AppleScript NSURL AppleScript NSURL File AppleScript NSURLBookmark AppleScript NSURLComponents AppleScript NSURLResourceKey AppleScript NSUserDefaults AppleScript NSUUID AppleScript NSView AppleScript NSWorkspace AppleScript Numbers AppleScript OAuth AppleScript ObjC AppleScript OneDrive AppleScript Osax AppleScript PDF AppleScript PDFAnnotationWidget AppleScript PDFContext AppleScript PDFDisplayBox AppleScript PDFDocumentPermissions AppleScript PDFKit AppleScript PDFnUP AppleScript PDFOutline AppleScript Photos AppleScript Photoshop AppleScript Plist System Events AppleScript PostScript AppleScript prefPane AppleScript Preview AppleScript Python AppleScript QR AppleScript QR Decode AppleScript QuickLook AppleScript QuickTime AppleScript record AppleScript Regular Expression AppleScript Reminders AppleScript ReName AppleScript Repeat AppleScript RTF AppleScript Safari AppleScript SaveFile AppleScript ScreenCapture AppleScript ScreenSaver AppleScript Script Editor AppleScript Script Menu AppleScript Shortcuts AppleScript Shortcuts Events AppleScript Sort AppleScript Sound AppleScript Spotlight AppleScript SRT AppleScript StandardAdditions AppleScript stringByApplyingTransform AppleScript System Events AppleScript System Settings AppleScript TemporaryItems AppleScript Terminal AppleScript Text AppleScript Text CSV AppleScript Text TSV AppleScript TextEdit AppleScript Translate AppleScript Trash AppleScript Twitter AppleScript UI AppleScript Unit Conversion AppleScript UTType AppleScript valueForKeyPath AppleScript Video AppleScript VisionKit AppleScript Visual Studio Code AppleScript webarchive AppleScript webp AppleScript Wifi AppleScript XML AppleScript XML EPUB AppleScript XML OPML AppleScript XML Plist AppleScript XML RSS AppleScript XML SVG AppleScript XML TTML AppleScript XML webloc AppleScript YouTube AppleScript Zero Suppress Applications Barcode OnLine Tools CityCode Design iPhone List Logs lsappinfo Memo Music perl PlistBuddy pluginkit postalcode ReadMe SF Symbols character id SF Symbols Entity sips Skype Slack sqlite TCC Tools Typography Video Wacom zoom