AppleScript Encode Decode

エンコード デコード

[PercentEncode]URLエンコード URLの%エンコード
https://quicktimer.cocolog-nifty.com/icefloe/2024/02/post-eaffe4.html
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-83082a.html
[PercentEncode]URLエンコード・デコード %エンコードされたURLのデコード
https://quicktimer.cocolog-nifty.com/icefloe/2024/02/post-61ea7b.html
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-2097e5.html
[HtmlEntities]エンコード
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-8a45de.html
[HtmlEntities]デコード
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-6bfb2b.html
[UnicodeEscape]エンコード
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-b8cbc8.html
[UnicodeEscape]デコード
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-2b4575.html
[OpenSSL]ファイルの復号化
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-a93aad.html
[OpenSSL]ファイルの暗号化
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-56c768.html
Base64
https://quicktimer.cocolog-nifty.com/icefloe/2023/12/post-cf4088.html
[Base64]エンコード
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-9dd5a5.html
[Base64]デコード
https://quicktimer.cocolog-nifty.com/icefloe/2023/09/post-f167b0.html

Propertiesファイルエンコード
https://quicktimer.cocolog-nifty.com/icefloe/2024/02/post-217260.html
Propertiesファイルのデコード
https://quicktimer.cocolog-nifty.com/icefloe/2024/02/post-98add2.html

|

Propertiesファイルのデコード


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

#!/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 appFileManager to refMe's NSFileManager's defaultManager()

#############################
###ダイアログ
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
############ デフォルトロケーション
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
set aliasDesktopDirPath to (ocidDesktopDirPathURL's absoluteURL()) as alias

############UTIリスト
###ANY
set listUTI to {"public.item"}
set strMes to ("propertiesファイルを選んでください") as text
set strPrompt to ("propertiesファイルを選んでください") as text
try
  ### ファイル選択時
  set aliasFilePath to (choose file strMes with prompt strPrompt default location (aliasDesktopDirPath) of type listUTI with invisibles and showing package contents without multiple selections allowed) as alias
on error
log "エラーしました"
return "エラーしました"
end try
#拡張子チェック
set strFilePath to (POSIX path of aliasFilePath) as text
set ocidFilePath to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePathURL to refMe's NSURL's fileURLWithPath:(ocidFilePath)
set strExtensionName to (ocidFilePathURL's pathExtension()) as text
if strExtensionName is not "properties" then
return "処理終了"
end if

#読み込み
set listResponse to refMe's NSString's stringWithContentsOfURL:(ocidFilePathURL) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)
set ocidReadString to (item 1 of listResponse)
#出力用テキスト初期化
set ocidDecodeString to refMe's NSMutableString's alloc()'s initWithCapacity:(0)
#改行でリストにして
set ocidChrSet to refMe's NSCharacterSet's characterSetWithCharactersInString:("\n")
set ocidReadStringsArray to ocidReadString's componentsSeparatedByCharactersInSet:(ocidChrSet)
#リスト=行毎処理
repeat with itemArray in ocidReadStringsArray
  set strInputText to itemArray as text
  set ocidInputStr to (refMe's NSMutableString's stringWithString:(strInputText))
  if strInputText contains "\\\\U" then
    set ocidDataStr to (ocidInputStr's dataUsingEncoding:(refMe's NSUTF8StringEncoding))
    set ocidDecodeStr to (refMe's NSString's alloc()'s initWithData:(ocidDataStr) encoding:(refMe's NSNonLossyASCIIStringEncoding))
    set ocidDataStr to (ocidDecodeStr's dataUsingEncoding:(refMe's NSUTF8StringEncoding))
    set ocidDecodeStr to (refMe's NSString's alloc()'s initWithData:(ocidDataStr) encoding:(refMe's NSNonLossyASCIIStringEncoding))
    set strDecodeText to ocidDecodeStr as text
    ### \U30a4 形式の場合
  else if strInputText contains "\\U" then
    set ocidDataStr to (ocidInputStr's dataUsingEncoding:(refMe's NSUTF8StringEncoding))
    set ocidDecodeStr to (refMe's NSString's alloc()'s initWithData:(ocidDataStr) encoding:(refMe's NSNonLossyASCIIStringEncoding))
    set strDecodeText to ocidDecodeStr as text
  else
    set strDecodeText to strInputText as text
  end if
  set strAppendText to (strDecodeText & "\n") as text
(ocidDecodeString's appendString:(strAppendText))
  
end repeat
#拡張子変更して
set ocidSaveFilePathURL to ocidFilePathURL's URLByAppendingPathExtension:("decode.text")
##保存
set listDone to ocidDecodeString's writeToURL:(ocidSaveFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)



####################################
######
####################################

on doUnicodeEscapeDecode(argInputText)
  set strInputText to argInputText as text
  set ocidInputStr to refMe's NSMutableString's stringWithString:(argInputText)
  ### \\U30a4 形式の場合
  if strInputText contains "\\\\U" then
    set ocidDataStr to ocidInputStr's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
    set ocidDecodeStr to refMe's NSString's alloc()'s initWithData:(ocidDataStr) encoding:(refMe's NSNonLossyASCIIStringEncoding)
    set ocidDataStr to ocidDecodeStr's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
    set ocidDecodeStr to refMe's NSString's alloc()'s initWithData:(ocidDataStr) encoding:(refMe's NSNonLossyASCIIStringEncoding)
    set strDecodeText to ocidDecodeStr as text
    ### \U30a4 形式の場合
  else if strInputText contains "\\U" then
    set ocidDataStr to ocidInputStr's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
    set ocidDecodeStr to refMe's NSString's alloc()'s initWithData:(ocidDataStr) encoding:(refMe's NSNonLossyASCIIStringEncoding)
    set strDecodeText to ocidDecodeStr as text
  else
log "何もしないで戻す"
    set strDecodeText to strInputText as text
  end if
return strDecodeText
end doUnicodeEscapeDecode




|

Propertiesファイルエンコード


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

#!/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 appFileManager to refMe's NSFileManager's defaultManager()

#############################
###ダイアログ
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
############ デフォルトロケーション
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
set aliasDesktopDirPath to (ocidDesktopDirPathURL's absoluteURL()) as alias

############UTIリスト
###ANY
set listUTI to {"public.item"}
set strMes to ("propertiesファイルを選んでください") as text
set strPrompt to ("propertiesファイルを選んでください") as text
try
  ### ファイル選択時
  set aliasFilePath to (choose file strMes with prompt strPrompt default location (aliasDesktopDirPath) of type listUTI with invisibles and showing package contents without multiple selections allowed) as alias
on error
log "エラーしました"
return "エラーしました"
end try
#拡張子チェック
set strFilePath to (POSIX path of aliasFilePath) as text
set ocidFilePath to refMe's NSString's stringWithString:(strFilePath)
set ocidFilePathURL to refMe's NSURL's fileURLWithPath:(ocidFilePath)
set strExtensionName to (ocidFilePathURL's pathExtension()) as text
if strExtensionName is not "text" then
return "処理終了"
end if

#読み込み
set listResponse to refMe's NSString's stringWithContentsOfURL:(ocidFilePathURL) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)
set ocidReadString to (item 1 of listResponse)
#出力用テキスト初期化
set ocidEncodeString to refMe's NSMutableString's alloc()'s initWithCapacity:(0)
#改行でリストにして
set ocidChrSet to refMe's NSCharacterSet's characterSetWithCharactersInString:("\n")
set ocidReadStringsArray to ocidReadString's componentsSeparatedByCharactersInSet:(ocidChrSet)
#リスト=行毎処理
repeat with itemArray in ocidReadStringsArray
  set strArray to itemArray as text
  if strArray contains "=" then
    set ocidChrSet to (refMe's NSCharacterSet's characterSetWithCharactersInString:("="))
    set ocidReadStringsArray to (itemArray's componentsSeparatedByCharactersInSet:(ocidChrSet))
    set ocidIndexStrings to ocidReadStringsArray's firstObject() as text
    set ocidPropertieStrings to ocidReadStringsArray's lastObject()
    set ocidEncodedText to (ocidPropertieStrings's stringByApplyingTransform:"Hex-Any" |reverse|:true)
    set strAppendText to (ocidIndexStrings & "=" & ocidEncodedText & "\n") as text
(ocidEncodeString's appendString:(strAppendText))
  else
    set strAppendText to (strArray & "\n") as text
(ocidEncodeString's appendString:(strAppendText))
  end if
end repeat
#拡張子変更して
log ocidEncodeString as text

set ocidBaseFilePathURL to ocidFilePathURL's URLByDeletingPathExtension()
set ocidSaveFilePathURL to ocidBaseFilePathURL's URLByAppendingPathExtension:("properties")
##保存
set listDone to ocidEncodeString's writeToURL:(ocidSaveFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)

log item 1 of listDone




|

%エンコードされた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

set strURL to "https://www.foo.com/cgi-lib/%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%AE%E3%83%91%E3%82%B9/url.cgi?AAAA=%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%AE%E3%82%AF%E3%82%A8%E3%83%AA%E3%83%BC"

set ocidURLstr to refMe's NSString's stringWithString:(strURL)
set ocidURL to ocidURLstr's stringByRemovingPercentEncoding
log ocidURL as text
-->
(*https://www.foo.com/cgi-lib/日本語のパス/url.cgi?AAAA=日本語のクエリー*)
return


|

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

set strURL to "https://www.foo.com/cgi-lib/日本語のパス/url.cgi?AAAA=日本語のクエリー"

set ocidURLstr to refMe's NSString's stringWithString:(strURL)
set ocidBaseURL to refMe's NSURL's alloc()'s initWithString:(ocidURLstr)
set ocidURLomponents to refMe's NSURLComponents's componentsWithURL:(ocidBaseURL) resolvingAgainstBaseURL:(false)
set ocidURL to ocidURLomponents's |URL|
set strURL to ocidURL's absoluteString() as text
log strURL as text

-->
(*https://www.foo.com/cgi-lib/encode/url.cgi?AAAA=%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%81%AE%E3%82%AF%E3%82%A8%E3%83%AA%E3%83%BC*)

return

|

Base64エンコード デコード

ダウンロード - base64.zip


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

#!/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 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/ClippingText.icns") as alias
try
  
  set strMes to "base64にエンコードします" 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 strBase64String to doBase64Enc(strReturnedText)

################################
##
################################
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/ClippingText.icns") as alias
try
  set strMes to "base64テキストです" as text
  
  set recordResult to (display dialog strMes with title "bundle identifier" default answer strBase64String buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" cancel button "キャンセル" giving up after 20 with icon aliasIconPath without hidden answer)
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 if button returned of recordResult is "クリップボードにコピー" then
  try
    set strText to text returned of recordResult as text
    ####ペーストボード宣言
    set appPasteboard to refMe's NSPasteboard's generalPasteboard()
    set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
  on error
    tell application "Finder"
      set the clipboard to strTitle as text
    end tell
  end try
else
return "キャンセル"
end if

####################################
###### base64 エンコード
####################################
on doBase64Enc(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##データにして
  set ocidTextData to ocidArgText's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
  ##エンコードテキストにする
  set ocidOption to (refMe's NSDataBase64Encoding64CharacterLineLength)
  set ocidBase64String to ocidTextData's base64EncodedStringWithOptions:(ocidOption)
  ##テキスト形式に確定
  set strBase64String to ocidBase64String as text
  ###値を戻す
return strBase64String
end doBase64Enc


####################################
###### base64 エンコード
####################################
on doBase64Decde(argText)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(argText)
  ##データにして
  set ocidOption to (refMe's NSDataBase64DecodingIgnoreUnknownCharacters)
  set ocidTextData to refMe's NSData's alloc()'s initWithBase64EncodedString:(ocidArgText) options:(ocidOption)
  ##デコード済みテキストにする
  set ocidDecodeString to refMe's NSString's alloc()'s initWithData:(ocidTextData) encoding:(refMe's NSUTF8StringEncoding)
  ##テキスト形式に確定
  set strDecodeString to ocidDecodeString as text
  ###値を戻す
return strDecodeString
end doBase64Decde


|

パスワード用の文字列生成


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

#!/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
###ダイアログを前に
tell current application
  set strName to name as text
end tell
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
###ダイアログ
set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/LockedIcon.icns"
set strMes to ("桁数指定してください")
set numDeg to (13) as integer
set recordResult to (display dialog strMes with title "入力してください" default answer numDeg buttons {"キャンセル", "記号あり", "記号なし"} default button "記号あり" cancel button "キャンセル" giving up after 20 with icon aliasIconPath without hidden answer)
###ボタンによる分岐
if button returned of recordResult is "記号なし" then
  set strText to text returned of recordResult as text
  set strCharSet to "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890123456789"
else if button returned of recordResult is "記号あり" then
  set strText to text returned of recordResult as text
  set strCharSet to "abcdefghijklmnopqrstuvwxyz0123456789@#$%&!¥=+?_-ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%&!¥=+?_-"
else
return "キャンセルしました"
end if
###不要な文字の除去
set ocidResponseText to (refMe's NSString's stringWithString:(strText))
###タブと改行を除去しておく
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 ocidDecSet to refMe's NSCharacterSet's decimalDigitCharacterSet
set ocidCharSet to ocidDecSet's invertedSet()
set ocidCharArray to ocidTextM's componentsSeparatedByCharactersInSet:(ocidCharSet)
set ocidInteger to ocidCharArray's componentsJoinedByString:""
###ボタンによる文字数の違いを数える
set numCntCharSet to (count of character of strCharSet) as integer
###出力用テキスト初期化
set strOutPutText to ("") as text
###パスワードは8コ生成する
repeat 8 times
  ###パスワード用文字列の初期化
  set strLineText to ("") as text
  ###指定の文字数分くりかえし
  repeat (ocidInteger as integer) times
    ###ランダム番号から
    set numRandomNo to (random number from 1 to numCntCharSet) as integer
    ###ランダム番号の文字列を取り出して
    set strTmp to character numRandomNo of strCharSet
    ###繋げてパスワード用の文字列とする
    set strLineText to (strLineText & strTmp) as text
  end repeat
  ###パスワード用の文字列毎に改行を入れて
  set strLineText to (strLineText & "\n") as text
  ###出力用テキストにする
  set strOutPutText to (strOutPutText & strLineText) as text
end repeat


#####ダイアログを前面に
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
###ダイアログ
set strIconPath to "/System/Library/CoreServices/Finder.app/Contents/Resources/Finder.icns"
set aliasIconPath to POSIX file strIconPath as alias
set recordResult to (display dialog "戻り値" with title "戻り値です" default answer strOutPutText buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" cancel button "キャンセル" giving up after 20 with icon aliasIconPath without hidden answer)

if button returned of recordResult is "クリップボードにコピー" then
  set strText to text returned of recordResult as text
  ####ペーストボード宣言
  set appPasteboard to refMe's NSPasteboard's generalPasteboard()
  set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
end if


|

[PercentEncode]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

################################
##デフォルトクリップボードからテキスト取得
################################
set appPasteboard to refMe's NSPasteboard's generalPasteboard()
set ocidTypeArray to appPasteboard's types()
set boolContain to ocidTypeArray's containsObject:("public.utf8-plain-text")
if boolContain = true then
  try
    set ocidPasteboardArray to appPasteboard's readObjectsForClasses:({refMe's NSString}) options:(missing value)
    set ocidPasteboardStrings to ocidPasteboardArray's firstObject()
  on error
    set ocidStringData to appPasteboard's stringForType:("public.utf8-plain-text")
    set ocidPasteboardStrings to (refMe's NSString's stringWithString:(ocidStringData))
  end try
else
  set ocidPasteboardStrings to (refMe's NSString's stringWithString:(""))
end if
set strDefaultAnswer to ocidPasteboardStrings as text

################################
######ダイアログ
################################
#####ダイアログを前面に
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
set aliasIconPath to (POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns") as alias
try
  set strMes to ("読める文字を%エンコードします\nテキストやURL等を入力してください") as text
  
  set recordResponse to (display dialog strMes with title "入力してください" default answer strDefaultAnswer buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 20 without hidden answer)
on error
  log "エラーしました"
return "エラーしました"
end try
if true is equal to (gave up of recordResponse) then
return "時間切れですやりなおしてください"
end if
if "OK" is equal to (button returned of recordResponse) then
  set strResponse to (text returned of recordResponse) as text
else
  log "キャンセルしました"
return "キャンセルしました"
end if

##############################
###URLと通常テキストの処理を分岐する
##URLの場合
if strResponse starts with "http" then
  ###タブと改行を除去しておく
  set ocidResponseText to refMe's NSString's stringWithString:(strResponse)
  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 strURL to ocidTextM as text
  set strURL to doUrlDecode(strURL)
  ##テキスト
  set ocidArgText to refMe's NSString's stringWithString:(strURL)
  set ocidArgTextArray to ocidArgText's componentsSeparatedByString:("?")
  set numCntArray to (count of ocidArgTextArray) as integer
  if numCntArray > 1 then
    set ocidBaseURLstr to ocidArgTextArray's firstObject()
ocidArgTextArray's removeObjectAtIndex:(0)
    set ocidQueryStr to ocidArgTextArray's componentsJoinedByString:("?")
    log ocidQueryStr as text
    set ocidArgTextArray to ocidQueryStr's componentsSeparatedByString:("=")
    set numCntArray to (count of ocidArgTextArray) as integer
    if numCntArray > 1 then
      log ocidArgTextArray as list
      set strNewQuery to ((ocidArgTextArray's firstObject() as text) & "=") as text
      repeat with itemIntNo from 1 to (numCntArray - 2) by 1
set ocidItem to (ocidArgTextArray's objectAtIndex:(itemIntNo))
log ocidItem as text
set ocidItemArray to (ocidItem's componentsSeparatedByString:("&"))
set numCntArray to (count of ocidItemArray) as integer
if numCntArray > 1 then
set ocidNextQue to ocidItemArray's lastObject()
(ocidItemArray's removeLastObject())
set ocidItemQueryStr to (ocidItemArray's componentsJoinedByString:("&"))
set strEncValue to doUrlEncode(ocidItemQueryStr as text)
set ocidEncValue to (refMe's NSString's stringWithString:(strEncValue))
set ocidEncValue to (ocidEncValue's stringByReplacingOccurrencesOfString:("&") withString:("%26"))
set strNewQuery to strNewQuery & ((ocidEncValue as text) & "&" & (ocidNextQue as text) & "=") as text
else
set strNewQuery to strNewQuery & ((ocidItemArray's firstObject() as text) & "&" & (ocidItemArray's lastObject() as text) & "=") as text
end if
      end repeat
      set strNewQuery to (strNewQuery & (ocidArgTextArray's lastObject() as text)) as text
      log strNewQuery
      set strEncText to ((ocidBaseURLstr as text) & "?" & strNewQuery) as text
    end if
    ##URLのクエリーにNameが無い場合
    set strEncText to ((ocidBaseURLstr as text) & "?" & (ocidQueryStr as text)) as text
    set strURL to doUrlDecode(strEncText)
    set strEncText to doUrlEncode(strURL)
  else
    ##URLに?がない=クエリーがない場合
    set ocidBaseURLstr to ocidArgTextArray's firstObject()
    set strURL to doUrlDecode(ocidBaseURLstr)
    set strEncText to doUrlEncode(strURL)
  end if
else
  ##通常テキストの場合
  set strText to strResponse as text
  set strText to doUrlDecode(strText) as text
  set strEncText to doTextEncode(strText) as text
end if
log strEncText
################################
######ダイアログ
################################
#####ダイアログを前面に
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns"
set strMes to ("戻り値です\r" & strEncText) as text

set recordResult to (display dialog strMes with title "%エンコード結果" default answer strEncText buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" cancel button "キャンセル" giving up after 20 with icon aliasIconPath without hidden answer)

if button returned of recordResult is "クリップボードにコピー" then
  try
    set strText to text returned of recordResult as text
    ####ペーストボード宣言
    set appPasteboard to refMe's NSPasteboard's generalPasteboard()
    set ocidText to (refMe's NSString's stringWithString:(strEncText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
  on error
    tell application "Finder"
      set the clipboard to strEncText as text
    end tell
  end try
end if






####################################
###### %デコード
####################################
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
####################################
###### %エンコード
####################################
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"} 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



|

[PercentEncode]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

################################
##デフォルトクリップボードからテキスト取得
################################
set appPasteboard to refMe's NSPasteboard's generalPasteboard()
set ocidTypeArray to appPasteboard's types()
set boolContain to ocidTypeArray's containsObject:("public.utf8-plain-text")
if boolContain = true then
  try
    set ocidPasteboardArray to appPasteboard's readObjectsForClasses:({refMe's NSString}) options:(missing value)
    set ocidPasteboardStrings to ocidPasteboardArray's firstObject()
  on error
    set ocidStringData to appPasteboard's stringForType:("public.utf8-plain-text")
    set ocidPasteboardStrings to (refMe's NSString's stringWithString:(ocidStringData))
  end try
else
  set ocidPasteboardStrings to (refMe's NSString's stringWithString:(""))
end if
set strDefaultAnswer to ocidPasteboardStrings as text

################################
######ダイアログ
################################
#####ダイアログを前面に
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
set aliasIconPath to (POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns") as alias
try
  set strMes to ("読める文字を%エンコードします\nテキストやURL等を入力してください") as text
  
  set recordResponse to (display dialog strMes with title "入力してください" default answer strDefaultAnswer buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 20 without hidden answer)
on error
  log "エラーしました"
return "エラーしました"
end try
if true is equal to (gave up of recordResponse) then
return "時間切れですやりなおしてください"
end if
if "OK" is equal to (button returned of recordResponse) then
  set strResponse to (text returned of recordResponse) as text
else
  log "キャンセルしました"
return "キャンセルしました"
end if

##通常テキストの場合
set strText to strResponse as text
set strDecodedText to doUrlDecode(strText) as text

################################
######ダイアログ
################################
#####ダイアログを前面に
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns"
set strMes to ("戻り値です\r" & strDecodedText) as text

set recordResult to (display dialog strMes with title "%デコード" default answer strDecodedText buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" cancel button "キャンセル" giving up after 20 with icon aliasIconPath without hidden answer)

if button returned of recordResult is "クリップボードにコピー" then
  try
    set strText to text returned of recordResult as text
    ####ペーストボード宣言
    set appPasteboard to refMe's NSPasteboard's generalPasteboard()
    set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
  on error
    tell application "Finder"
      set the clipboard to strText as text
    end tell
  end try
end if






####################################
###### %デコード
####################################
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
####################################
###### %エンコード
####################################
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"} 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



|

[UnicodeEscape]エンコード


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

#!/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 appPasteboard to refMe's NSPasteboard's generalPasteboard()
set ocidTypeArray to appPasteboard's types()
set boolContain to ocidTypeArray's containsObject:("public.utf8-plain-text")
if boolContain = true then
  try
    set ocidPasteboardArray to appPasteboard's readObjectsForClasses:({refMe's NSString}) options:(missing value)
    set ocidPasteboardStrings to ocidPasteboardArray's firstObject()
  on error
    set ocidStringData to appPasteboard's stringForType:("public.utf8-plain-text")
    set ocidPasteboardStrings to (refMe's NSString's stringWithString:(ocidStringData))
  end try
else
  set ocidPasteboardStrings to (refMe's NSString's stringWithString:(""))
end if
set strDefaultAnswer to ocidPasteboardStrings as text

################################
######ダイアログ
################################
#####ダイアログを前面に
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
set aliasIconPath to (POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns") as alias
try
  set strMes to ("読める文字を%エンコードします\nテキストやURL等を入力してください") as text
  
  set recordResponse to (display dialog strMes with title "入力してください" default answer strDefaultAnswer buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 20 without hidden answer)
on error
  log "エラーしました"
return "エラーしました"
end try
if true is equal to (gave up of recordResponse) then
return "時間切れですやりなおしてください"
end if
if "OK" is equal to (button returned of recordResponse) then
  set strResponse to (text returned of recordResponse) as text
else
  log "キャンセルしました"
return "キャンセルしました"
end if

##通常テキストの場合
set strText to strResponse as text
(* ###改行 タブの除去
set ocidText to refMe's NSString's stringWithString:(strText)
set ocidTextM to refMe's NSMutableString's alloc()'s initWithCapacity:(0)
ocidURLM's appendString:(ocidText)
##行末の改行
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 strTextM to ocidTextM as text
*)

set strDecodedText to doUnicodeEscapeDecode(strText) as text

################################
######ダイアログ
################################
#####ダイアログを前面に
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertNoteIcon.icns"
set strMes to ("戻り値です\r" & strDecodedText) as text

set recordResult to (display dialog strMes with title "%デコード" default answer strDecodedText buttons {"クリップボードにコピー", "キャンセル", "OK"} default button "OK" cancel button "キャンセル" giving up after 20 with icon aliasIconPath without hidden answer)

if button returned of recordResult is "クリップボードにコピー" then
  try
    set strText to text returned of recordResult as text
    ####ペーストボード宣言
    set appPasteboard to refMe's NSPasteboard's generalPasteboard()
    set ocidText to (refMe's NSString's stringWithString:(strText))
appPasteboard's clearContents()
appPasteboard's setString:(ocidText) forType:(refMe's NSPasteboardTypeString)
  on error
    tell application "Finder"
      set the clipboard to strText as text
    end tell
  end try
end if






####################################
######
####################################

on doUnicodeEscapeDecode(argInputText)
  set strInputText to argInputText as text
  set ocidInputStr to refMe's NSMutableString's stringWithString:(argInputText)
  ### \\U30a4 形式の場合
  if strInputText contains "\\\\U" then
    set ocidDataStr to ocidInputStr's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
    set ocidDecodeStr to refMe's NSString's alloc()'s initWithData:(ocidDataStr) encoding:(refMe's NSNonLossyASCIIStringEncoding)
    set ocidDataStr to ocidDecodeStr's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
    set ocidDecodeStr to refMe's NSString's alloc()'s initWithData:(ocidDataStr) encoding:(refMe's NSNonLossyASCIIStringEncoding)
    set strDecodeText to ocidDecodeStr as text
    ### \U30a4 形式の場合
  else if strInputText contains "\\U" then
    set ocidDataStr to ocidInputStr's dataUsingEncoding:(refMe's NSUTF8StringEncoding)
    set ocidDecodeStr to refMe's NSString's alloc()'s initWithData:(ocidDataStr) encoding:(refMe's NSNonLossyASCIIStringEncoding)
    set strDecodeText to ocidDecodeStr as text
  else
    log "何もしないで戻す"
    set strDecodeText to strInputText as text
  end if
return strDecodeText
end doUnicodeEscapeDecode



|

その他のカテゴリー

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