Tools

Colour Contrast Analyzer (CCA)WCAG 2.1対応版

202404301007502104x810

|

[Plist]市区町村コード検索

ダウンロード - 市区町村コード検索.zip


1:タブ区切りテキストからPlistを作成する
2:Plistを検索語句で検索結果をHTML表示する

1:タブ区切りテキストからPlistを作成する

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#タブ区切りテキストからPlistを生成する
#単体動作しません
(*
https://quicktimer.cocolog-nifty.com/icefloe/files/e5b882e58cbae794bae69d91e382b3e383bce38388e38299e6a49ce7b4a2.zip
ダウンロードして利用してください
*)
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application

##########################################
###【1】ドキュメントのパスをNSString
tell application "Finder"
  set aliasPathToMe to (path to me) as alias
end tell
set strPathToMe to (POSIX path of aliasPathToMe) as text
set ocidPathToMeStr to refMe's NSString's stringWithString:(strPathToMe)
set ocidPathToMe to ocidPathToMeStr's stringByStandardizingPath()
set ocidPathToMeURL to refMe's NSURL's fileURLWithPath:(ocidPathToMe)
set ocidPathToMeContainerDirURL to ocidPathToMeURL's URLByDeletingLastPathComponent()
set ocidFilePathURL to ocidPathToMeContainerDirURL's URLByAppendingPathComponent:("data/都道府県名.tsv")
##########################################
### 【2】テキスト読み込み
set listReadText to refMe's NSString's alloc()'s initWithContentsOfURL:(ocidFilePathURL) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)
set ocidReadText to (item 1 of listReadText)
##########################################
### 【3】改行でArray
set ocidChrSet to refMe's NSCharacterSet's newlineCharacterSet()
set ocidRootArray to ocidReadText's componentsSeparatedByCharactersInSet:(ocidChrSet)
##########################################
###出力用のDICT
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
##ROOTのARRAY
set ocidCityArrayM to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
### 【4】行毎にタブ区切りでArrrayにする
repeat with itemLineText in ocidRootArray
  ##タブ区切り
  set ocidChrSet to (refMe's NSCharacterSet's characterSetWithCharactersInString:("\t"))
  ##タブ区切りでArray
  set ocidLineArray to (itemLineText's componentsSeparatedByCharactersInSet:(ocidChrSet))
  ##変換出力用のDICT
  set ocidCityDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
  ###
  set ocidArray1Str to (ocidLineArray's objectAtIndex:(0))
(ocidCityDict's setObject:(ocidArray1Str) forKey:"cityCode")
  ##
  set ocidArray2Str to (ocidLineArray's objectAtIndex:(1))
(ocidCityDict's setObject:(ocidArray2Str) forKey:"prefectures")
  ##
  set ocidArray3Str to (ocidLineArray's objectAtIndex:(2))
(ocidCityDict's setObject:(ocidArray3Str) forKey:"city")
  ##半角カナ
  set ocidArray4Str to (ocidLineArray's objectAtIndex:(3))
(ocidCityDict's setObject:(ocidArray4Str) forKey:"prefectures-han-kana")
  ##
  set ocidArray5Str to (ocidLineArray's objectAtIndex:(4))
(ocidCityDict's setObject:(ocidArray5Str) forKey:"city-han-kana")
  ##
(ocidCityDict's setObject:((ocidArray4Str as text) & (ocidArray5Str as text)) forKey:"halfWidthKana")
  ##
  set ocidNSStringTransform to (refMe's NSStringTransformFullwidthToHalfwidth)
  set ocidPrefecturesKana to (ocidArray4Str's stringByApplyingTransform:(ocidNSStringTransform) |reverse|:true)
(ocidCityDict's setObject:(ocidPrefecturesKana) forKey:"prefectures-kana")
  ##
  set ocidCityKana to (ocidArray5Str's stringByApplyingTransform:(ocidNSStringTransform) |reverse|:true)
(ocidCityDict's setObject:(ocidCityKana) forKey:"city-han-kana")
  ##
(ocidCityDict's setObject:((ocidPrefecturesKana as text) & (ocidCityKana as text)) forKey:"fullWidthKana")
  ##
  set ocidNSStringTransform to (refMe's NSStringTransformHiraganaToKatakana)
  set ocidPrefecturesHira to (ocidArray4Str's stringByApplyingTransform:(ocidNSStringTransform) |reverse|:true)
(ocidCityDict's setObject:(ocidPrefecturesHira) forKey:"prefectures-hirakana")
  ##
  set ocidCityHira to (ocidArray5Str's stringByApplyingTransform:(ocidNSStringTransform) |reverse|:true)
(ocidCityDict's setObject:(ocidCityHira) forKey:"city-hirakana")
  ##
(ocidCityDict's setObject:((ocidPrefecturesHira as text) & (ocidCityHira as text)) forKey:"hiragana")
  ###
(ocidCityArrayM's addObject:(ocidCityDict))
  
end repeat

ocidPlistDict's setObject:(ocidCityArrayM) forKey:("data")

set ocidFormat to (refMe's NSPropertyListBinaryFormat_v1_0)
set listPlistData to refMe's NSPropertyListSerialization's dataWithPropertyList:(ocidPlistDict) format:(ocidFormat) options:0 |error|:(reference)
set ocidPlistData to (item 1 of listPlistData)
log className() of ocidPlistData as text
##########################################
set ocidContainerPathURL to ocidFilePathURL's URLByDeletingLastPathComponent()
set strSaveFileName to ("PrefecturesData.plist") as text
set ocidSaveFilePathURL to ocidContainerPathURL's URLByAppendingPathComponent:(strSaveFileName)
####【4】保存 ここは上書き
set ocidOption to (refMe's NSDataWritingAtomic)
set listDOne to ocidPlistData's writeToURL:(ocidSaveFilePathURL) options:(ocidOption) |error|:(reference)

log (item 1 of listDOne)
if (item 1 of listDOne) = true then
return "正常終了"
else
return "保存に失敗しました"
end if

2:Plistを検索語句で検索結果をHTML表示する

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#PlistのValue値を検索する
#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
property refNSNotFound : a reference to 9.22337203685477E+18 + 5807

########################
## クリップボードの中身取り出し
########################
###初期化
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 "1" 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 strMes to ("検索語句 市区町村関連") as text
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 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:("")
##########################################
###【1】ドキュメントのパスをNSString
tell application "Finder"
  set aliasPathToMe to (path to me) as alias
end tell
set strPathToMe to (POSIX path of aliasPathToMe) as text
set ocidPathToMeStr to refMe's NSString's stringWithString:(strPathToMe)
set ocidPathToMe to ocidPathToMeStr's stringByStandardizingPath()
set ocidPathToMeURL to refMe's NSURL's fileURLWithPath:(ocidPathToMe)
set ocidPathToMeContainerDirURL to ocidPathToMeURL's URLByDeletingLastPathComponent()
set ocidFilePathURL to ocidPathToMeContainerDirURL's URLByAppendingPathComponent:("data/PrefecturesData.plist")
##########################################
###【2】PLISTを可変レコードとして読み込み
set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s initWithContentsOfURL:(ocidFilePathURL)
###データをArrayで取り出して
set ocidDataArray to ocidPlistDict's objectForKey:("data")
###
set ocidOutPutArrayM to refMe's NSMutableArray's alloc()'s initWithCapacity:(0)
###dataのarrayの数だけ繰り返し
repeat with itemDataDict in ocidDataArray
  ##dataArrayのItemはDictなのでValueを取って
  set ocidAllValueKey to itemDataDict's allValues()
  ##検索用に文字列にして
  set ocidAllValueStr to (ocidAllValueKey's componentsJoinedByString:(","))
  ##検索してレンジを求める
  set ocidOption to (refMe's NSCaseInsensitiveSearch)
  set ocidLocation to (ocidAllValueStr's rangeOfString:(ocidTextM) options:(ocidOption))'s location()
  ###NotFoundでは無い=検索語句があったなので
  if ocidLocation ≠ refNSNotFound then
    ###対象のitemDictを出力用のArrayに格納する
(ocidOutPutArrayM's addObject:(itemDataDict))
  end if
end repeat
log ocidOutPutArrayM as list

#############################################
###HTML保存先ディレクトリ
set appFileManager to refMe's NSFileManager's defaultManager()
set ocidTempDirURL to appFileManager's temporaryDirectory()
set ocidUUID to refMe's NSUUID's alloc()'s init()
set ocidUUIDString to ocidUUID's UUIDString
set ocidSaveDirPathURL to ocidTempDirURL's URLByAppendingPathComponent:(ocidUUIDString) isDirectory:true
###保存先ディレクトリ作成
set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
# 777-->511 755-->493 700-->448 766-->502
ocidAttrDict's setValue:(511) forKey:(refMe's NSFilePosixPermissions)
set listBoolMakeDir to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error|:(reference)
###パス
set strFileName to ((ocidTextM as text) & ".html") as text
set ocidSaveFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:(strFileName) isDirectory:false

##HTML 基本構造
###スタイル
set strStylle to "<style>#bordertable {padding: 10px;width: 100%;margin: 0;border-collapse: collapse;border-spacing: 0;word-wrap: break-word;} #bordertable table { width: 580px;margin: 0px;padding: 0px;border: 0px;border-spacing:0px;border-collapse: collapse;} #bordertable caption { font-weight: 900;} #bordertable thead { font-weight: 600;border-spacing:0px;} #bordertable td {border: solid 1px #666666;padding: 5px;margin: 0px;word-wrap: break-word;border-spacing:0px;} #bordertable tr {border: solid 1px #666666;padding: 0px;margin: 0px;border-spacing:0px;} #bordertable th {border: solid 1px #666666;padding: 0px;margin: 0px;border-spacing:0px;}</style>"
###ヘッダー部
set strHead to "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"utf-8\"><title>[Plist2HTML]" & (ocidTextM as text) & "</title>" & strStylle & "</head><body>"
###ボディ
set strBody to ""
###最後
set strHtmlEndBody to "</body></html>"
###HTML書き出し用のテキスト初期化
set ocidHTMLString to refMe's NSMutableString's alloc()'s initWithCapacity:0
###bodyまでを追加
(ocidHTMLString's appendString:(strHead))
#############################################
###
###テーブルの開始部
set strHTML to ("<div id=\"bordertable\"><table><caption title=\"タイトル\">市区町村</caption>") as text
set strHTML to (strHTML & "<thead title=\"項目名称\"><tr><th title=\"項目1\" scope=\"row\" > 連番 </th><th title=\"項目2\" scope=\"col\">都道府県</th><th title=\"項目3\" scope=\"col\"> 名称 </th><th title=\"項目4\" scope=\"col\">市番号</th><th title=\"項目5\" scope=\"col\">かな</th><th title=\"項目6\" scope=\"col\">カナ</th></tr></thead><tbody title=\"市区町村一覧\" >") as text
set numLineNo to 1 as integer
repeat with itemData in ocidOutPutArrayM
  ###Arrayから値の取り出して
  set strCity to (itemData's valueForKey:("city")) as text
  set strCityCode to (itemData's valueForKey:("cityCode")) as text
  set strHiragana to (itemData's valueForKey:("hiragana")) as text
  set strKana to (itemData's valueForKey:("fullWidthKana")) as text
  set strPrefectures to (itemData's valueForKey:("prefectures")) as text
  (*
set ocidLocDic to (itemData's objectForKey:("location"))
set strLat to (ocidLocDic's valueForKey:("latitude")) as text
set strLon to (ocidLocDic's valueForKey:("longitude")) as text
set strMapURL to ("https://www.google.com/maps/@" & strLat & "," & strLon & ",13z")
*)
  ## set strLINK to "<a href=\"" & strMapURL & "\" target=\"_blank\">LINK</a>"
  set strHTML to (strHTML & "<tr><th title=\"項番1\" scope=\"row\">" & numLineNo & "</th><td title=\"項目2\">" & strPrefectures & "</td><td title=\"項目3\">" & strCity & "</td><td title=\"項目4\">" & strCityCode & "</td><td title=\"項目5\">" & strHiragana & "</td><td title=\"項目6\">" & strKana & "</td></tr>") as text
  set numLineNo to numLineNo + 1 as integer
end repeat


set strHTML to (strHTML & "</tbody><tfoot><tr><th colspan=\"6\" title=\"フッター表の終わり\" scope=\"row\">JAPAN POSTAL CODE WEB API</th></tr></tfoot></table></div>") as text
####テーブルまでを追加
(ocidHTMLString's appendString:(strHTML))
####終了部を追加
(ocidHTMLString's appendString:(strHtmlEndBody))

###ファイルに書き出し
set listDone to ocidHTMLString's writeToURL:(ocidSaveFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error|:(reference)
####テキストエディタで開く
set aliasFilePath to (ocidSaveFilePathURL's absoluteURL()) as alias
tell application "TextEdit"
  activate
  open file aliasFilePath
end tell

|

[TOOLS]iOS-Runtime-Headers

20220908-163710

コード作成のお供に
https://github.com/nst/iOS-Runtime-Headers

|

[IP]IPアドレスとホスト名を取得する(グローバル・アドレス)

ダウンロード - dnsjson.scpt.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.4"
use framework "Foundation"
use scripting additions
property objMe : a reference to current application
property objNSString : a reference to objMe's NSString
property objNSDictionary : a reference to objMe's NSDictionary
property objNSMutableString : a reference to objMe's NSMutableString
property objNSJSONSerialization : a reference to objMe's NSJSONSerialization


set listDNS to {"cloudflare", "google"}
try
set objResponse to (choose from list listDNS with title "選んでください" with prompt "DNSを選んでください" default items (item 2 of listDNS) OK button name "OK" cancel button name "キャンセル" with multiple selections allowed without empty selection allowed)
on error
log "エラーしました"
return
end try
if objResponse is false then
return
end if

set theResponse to (objResponse) as text



####自分のグローバルIPアドレスの取得
set strGetIpCommandText to ("/usr/bin/curl 'https://api.ipify.org?format=text'") as text
set strIP to (do shell script strGetIpCommandText) as text
###NSString
set ocidIP to objNSString's stringWithString:strIP
###ドットを区切り文字にリスト化
set ocidIpNSArray to ocidIP's componentsSeparatedByString:"."
###逆順用のリストを用意して
set ocidIpReverse to objNSMutableString's |string|()
###逆順リストに追加していきく
ocidIpReverse's appendString:(ocidIpNSArray's objectAtIndex:3)
ocidIpReverse's appendString:"."
ocidIpReverse's appendString:(ocidIpNSArray's objectAtIndex:2)
ocidIpReverse's appendString:"."
ocidIpReverse's appendString:(ocidIpNSArray's objectAtIndex:1)
ocidIpReverse's appendString:"."
ocidIpReverse's appendString:(ocidIpNSArray's objectAtIndex:0)

######IPアドレスからホスト名を取得
if theResponse is "cloudflare" then
###コマンド整形
####cloudflare-dns.com
set strDnsCommandText to ("/usr/bin/curl -H 'accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=" & (ocidIpReverse as text) & ".in-addr.arpa&type=PTR'") as text
####コマンド実行
set jsonDnsQuery to (do shell script strDnsCommandText) as text
else
####dns.google
set strDnsCommandText to ("/usr/bin/curl -X GET -H 'Content-Type: application/json' 'https://dns.google/resolve?name=" & (ocidIpReverse as text) & ".in-addr.arpa&type=PTR&cd=true&do=true'") as text
####コマンド実行
set jsonDnsQuery to (do shell script strDnsCommandText) as text
end if


###戻り値のJSONをレコードに格納
set ocidResJson to (objNSJSONSerialization's JSONObjectWithData:((objNSString's stringWithString:jsonDnsQuery)'s dataUsingEncoding:(objMe's NSUTF8StringEncoding)) options:0 |error|:(missing value))

####データ取得確認
set numStatus to (Status of ocidResJson) as text
if numStatus is not "0" then
log "JSONデータの取得に失敗しました"
return
error number -128
end if

####Authorityを取得
set ocidAnswerArray to ocidResJson's Answer
####Answer』はリストArrayなので1つ目を取得する
set ocidAuthorityDictionary to ocidAnswerArray's objectAtIndex:0
####↑で取得したディレクトリの『data』を取得-->ホスト名
set ocidHostName to ocidAuthorityDictionary's valueForKey:"data"

log className() of ocidHostName as text
log ocidHostName as text

#####ダイアログを出す
set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/BookmarkIcon.icns" as alias
set theResponse to "" & (ocidIpReverse as text) & "\r" & (ocidHostName as text) & "" as text

display dialog "IP:" & (ocidIpReverse as text) & "\rHostName:" & (ocidHostName as text) & "" with title "グローバル情報" default answer theResponse buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 10 without hidden answer


return

|

[Google] Public DNS

https://dns.google
APIも提供しています

20220517114735_1268x606x1440

|

[WIFI]WIFIの電源のOFF-ON

ダウンロード - wifioffon.scpt.zip

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

tell application "System Events"
set listAppList to title of (every process where background only is false)
end tell
repeat with objAppList in listAppList
set strAppList to objAppList as text
if strAppList is "スクリプトエディタ" then
tell application "Script Editor"
if frontmost is true then
try
tell application "System Events" to click menu item "ログを表示" of menu "表示" of menu bar item "表示" of menu bar 1 of application process "Script Editor"
end try
end if
end tell
end if
end repeat

property objMe : a reference to current application
property objNSString : a reference to objMe's NSString
property objNSArray : a reference to objMe's NSArray

#####ネットワークサービスの一覧
set strNetWorkServices to (do shell script "/usr/sbin/networksetup -listallnetworkservices") as text
set ocidNetWorkServices to objNSString's stringWithString:strNetWorkServices
set ocidNSArrayNetWorkServices to ocidNetWorkServices's componentsSeparatedByString:"\r"
ocidNSArrayNetWorkServices's removeObjectAtIndex:0

try
set objResponse to (choose from list (ocidNSArrayNetWorkServices as list) with title "選んでください" with prompt "WIFIポートを選んでください" default items (item 2 of (ocidNSArrayNetWorkServices as list)) OK button name "OK" cancel button name "キャンセル" with multiple selections allowed without empty selection allowed)
on error
log "エラーしました"
return
end try
if objResponse is false then
return
end if
set strNetWorkName to (objResponse) as text

#####ハードウェアポートの一覧
set strHardWarePorts to (do shell script "/usr/sbin/networksetup -listallhardwareports") as text
set ocidHardWarePorts to objNSString's stringWithString:strHardWarePorts
set ocidNSArrayNetWorkPorts to ocidHardWarePorts's componentsSeparatedByString:"\r\r"

#####ポート分繰り返し
repeat with objNetWorkPorts in ocidNSArrayNetWorkPorts
set strNetWorkPorts to objNetWorkPorts as text
if strNetWorkPorts contains strNetWorkName then
#####文字列を整形
set ocidNetWorkPorts to (objNSString's stringWithString:strNetWorkPorts)
set ocidSelectNetWorkPorts to (ocidNetWorkPorts's componentsSeparatedByString:"\r")
set ocidDeviceLinet to (ocidSelectNetWorkPorts's objectAtIndex:1)
#####デバイス名を取得
set ocidSearchString to (objNSString's stringWithString:"Device: ")
set ocidReplacementString to (objNSString's stringWithString:"")
set ocidDeviceName to (ocidDeviceLinet's stringByReplacingOccurrencesOfString:ocidSearchString withString:ocidReplacementString)

end if
end repeat
####対象のデバイスの電源を取得
set strWifiStatus to (do shell script "/usr/sbin/networksetup -getairportpower '" & ocidDeviceName & "'") as text
set ocidWifiStatus to (objNSString's stringWithString:strWifiStatus)
set ocidArrayWifiStatus to (ocidWifiStatus's componentsSeparatedByString:": ")
set ocidWifiStatus to (ocidArrayWifiStatus's objectAtIndex:1)

####OFF-ON処理
if (ocidWifiStatus as text) contains "On" then
try
do shell script "/usr/sbin/networksetup -setairportpower '" & strNetWorkName & "' off"
end try
else
try
do shell script "/usr/sbin/networksetup -setairportpower '" & strNetWorkName & "' on"
end try
end if


return

|

[networkQuality]ネットワークスピードテスト

ダウンロード - networkquality.zip


#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
##自分環境がos12なので2.8にしているだけです
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

tell application "System Events"
set listAppList to title of (every process where background only is false)
end tell
repeat with objAppList in listAppList
set strAppList to objAppList as text
if strAppList is "スクリプトエディタ" then
tell application "Script Editor"
if frontmost is true then
try
tell application "System Events" to click menu item "ログを表示" of menu "表示" of menu bar item "表示" of menu bar 1 of application process "Script Editor"
end try
end if
end tell
end if
end repeat


set strDialog to ""

set strCommandText to "/usr/bin/networkQuality" as text

set strResponse to (do shell script strCommandText) as text


set AppleScript's text item delimiters to "\r"
set listResponse to every text item of strResponse
set AppleScript's text item delimiters to ""

set strDialog to ("" & strDialog & "\r" & (item 7 of listResponse) & "") as text


set aliasIconPath to POSIX file "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/GenericNetworkIcon.icns" as alias

try
set objResponse to (display dialog strDialog with title "ネットワーク スピードテスト" default answer strResponse 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 objResponse) then
return "時間切れですやりなおしてください"
end if
if "OK" is equal to (button returned of objResponse) then
set theResponse to (text returned of objResponse) as text
else
return "キャンセル"
end if

|

[Tools]xattred.app

https://eclecticlight.co/xattred-sandstrip-xattr-tools/

ファイルやフォルダに付与された属性を操作できます
Xattred126

|

[Dev]Assets.carファイルからリソースデータを取り出す

システム環境設定.appのように、アイコンデータが『Assets.car』になっている場合の
データの取り出し

AssetCatalogTinkerer
https://github.com/insidegui/AssetCatalogTinkererを使って取り出せます。

20220326200953_1280x7772

↑のところにビルドしてあるバージョンがあります

|

[ブラウザ] chromium

chromium
スナップショットは
https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html

ARM版は
https://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?prefix=Mac_Arm/

|

その他のカテゴリー

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