Notes

[メモ・Note]選択したメモをファイル出力(複数のメモを単一ファイルにまとめて出力)

選択したノートをファイル出力.scpt

AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004# 選択したノートをテキストファイルに出力します
005# 20250214 v1.1 リスト選択の排他を修正した
006#com.cocolog-nifty.quicktimer.icefloe
007----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
008use AppleScript version "2.8"
009use framework "Foundation"
010use framework "AppKit"
011use scripting additions
012property refMe : a reference to current application
013
014
015
016set listAccountName to {} as list
017
018tell application "Notes"
019  set listAccount to every account as list
020  set numAccount to (count of listAccount) as number
021  repeat with objAccount in listAccount
022    tell objAccount
023      set objAccountID to id
024      set strAccountName to name as text
025    end tell
026    copy "" & strAccountName & "" to end of listAccountName
027  end repeat
028end tell
029
030if listAccount is {} then
031  return "アカウントがありません"
032end if
033
034#####ダイアログを前面に
035tell current application
036  set strName to name as text
037end tell
038if strName is "osascript" then
039  tell application "Finder" to activate
040else
041  tell current application to activate
042end if
043
044try
045  set strTitle to ("アカウントを選択してください") as text
046  set strPrompt to ("アカウントを選択してください") as text
047  set objResponse to (choose from list listAccountName with title strTitle with prompt strPrompt default items (item 1 of listAccountName) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed)
048on error
049  log "エラーしました"
050  return
051end try
052if objResponse is false then
053  return
054end if
055set strAccount to objResponse as text
056
057set listFolderName to {} as list
058tell application "Notes"
059  ##  show account strAccount with separately
060  tell account strAccount
061    set listFolderName to name of every folder
062  end tell
063end tell
064if listFolderName is {} then
065  return "フォルダがありません"
066end if
067#####ダイアログを前面に
068tell current application
069  set strName to name as text
070end tell
071if strName is "osascript" then
072  tell application "Finder" to activate
073else
074  tell current application to activate
075end if
076try
077  set strTitle to ("フォルダを選択してください") as text
078  set strPrompt to ("フォルダを選択してください") as text
079  set objResponse to (choose from list listFolderName with title strTitle with prompt strPrompt default items (item 1 of listFolderName) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed)
080on error
081  log "エラーしました"
082  return
083end try
084if objResponse is false then
085  return
086end if
087set strFolderName to objResponse as text
088(*
089tell application "Notes"
090  ##  show account strAccount with separately
091  tell account strAccount
092    show folder strFolderName with separately
093    properties
094    tell folder strFolderName
095      properties
096    end tell
097  end tell
098end tell
099*)
100set listNoteName to {} as list
101tell application "Notes"
102  ##  show account strAccount with separately
103  tell account strAccount
104    tell folder strFolderName
105      set listNoteName to name of every note
106    end tell
107  end tell
108end tell
109
110if listNoteName is {} then
111  return "ノートがありません"
112end if
113
114#####ダイアログを前面に
115tell current application
116  set strName to name as text
117end tell
118if strName is "osascript" then
119  tell application "Finder" to activate
120else
121  tell current application to activate
122end if
123try
124  set strTitle to ("ノートを選択してください") as text
125  set strPrompt to ("ノートを選択してください") as text
126  set objResponse to (choose from list listNoteName with title strTitle with prompt strPrompt default items (item 1 of listNoteName) OK button name "OK" cancel button name "キャンセル" with multiple selections allowed without empty selection allowed)
127on error
128  log "エラーしました"
129  return
130end try
131if objResponse is false then
132  return
133end if
134set listNoteName to objResponse as list
135####出力用のテキスト
136set ocidOutputString to refMe's NSMutableString's alloc()'s init()
137set ocidOutputBodyString to refMe's NSMutableString's alloc()'s init()
138#
139set strHeader to ("<!DOCTYPE html>\n<html lang=\"ja\">\n<head>\n<meta charset=\"UTF-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n<title>" & strAccount & "</title>\n</head>\n<body>\n<header>\n<nav>\n</nav>フォルダー:" & strFolderName & "\n</header>\n<main>\n<section>")
140(ocidOutputBodyString's appendString:(strHeader))
141
142tell application "Notes"
143  # show account strAccount with separately
144  tell account strAccount
145    # show with separately
146    tell folder strFolderName
147      #   show with separately
148      repeat with itemNoteName in listNoteName
149        tell note itemNoteName
150          properties
151          set strID to id as text
152          tell note id strID
153            #   properties
154          end tell
155          set strName to name as text
156          set strBody to body as text
157          set strPlainText to plaintext as text
158          #
159          # (ocidOutputBodyString's appendString:(strName))
160          # (ocidOutputBodyString's appendString:("<br>"))
161          (ocidOutputBodyString's appendString:(strBody))
162          (ocidOutputBodyString's appendString:("<hr>"))
163          #
164          (ocidOutputString's appendString:(strName))
165          (ocidOutputString's appendString:("\n"))
166          (ocidOutputString's appendString:(strPlainText))
167          (ocidOutputString's appendString:("\n------\n"))
168          
169        end tell
170      end repeat
171    end tell
172  end tell
173end tell
174
175
176
177set strDateno to doGetDateNo()
178set strFooter to ("</section>\n</main>\n<footer>\n<p>" & strDateno & "日取得</p>\n</footer>\n</body>\n</html>") as text
179(ocidOutputBodyString's appendString:(strFooter))
180
181
182#保存先
183set appFileManager to refMe's NSFileManager's defaultManager()
184set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDesktopDirectory) inDomains:(refMe's NSUserDomainMask))
185set ocidDesktopDirPathURL to ocidURLsArray's firstObject()
186#パス
187set ocidTextFilePathURL to ocidDesktopDirPathURL's URLByAppendingPathComponent:("ノート出力.txt") isDirectory:(false)
188set ocidBodyFilePathURL to ocidDesktopDirPathURL's URLByAppendingPathComponent:("ノート出力.html") isDirectory:(false)
189#保存
190set listDone to ocidOutputString's writeToURL:(ocidTextFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error| :(reference)
191
192set listDone to ocidOutputBodyString's writeToURL:(ocidBodyFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error| :(reference)
193
194
195return
196
197################################
198# 日付 doGetDateNo()
199################################
200to doGetDateNo()
201  ###今日
202  set ocidDate to (current application's NSDate's |date|())
203  ###フォーマット初期化
204  set ocidFormatterJP to current application's NSDateFormatter's alloc()'s init()
205  ###日本のカレンダー
206  set ocidCalendarID to (current application's NSCalendarIdentifierJapanese)
207  set ocidCalendarJP to current application's NSCalendar's alloc()'s initWithCalendarIdentifier:(ocidCalendarID)
208  ###東京タイムゾーン
209  set ocidTimezoneJP to current application's NSTimeZone's alloc()'s initWithName:("Asia/Tokyo")
210  ###日本語
211  set ocidLocaleJP to current application's NSLocale's alloc()'s initWithLocaleIdentifier:("ja_JP_POSIX")
212  ###フォーマットをセット
213  ocidFormatterJP's setTimeZone:(ocidTimezoneJP)
214  ocidFormatterJP's setLocale:(ocidLocaleJP)
215  ocidFormatterJP's setCalendar:(ocidCalendarJP)
216  ocidFormatterJP's setDateStyle:(current application's NSDateFormatterFullStyle)
217  ocidFormatterJP's setDateFormat:("GGyy")
218  ###今日の日付にフォーマットを適応
219  set ocidDateStringEra to ocidFormatterJP's stringFromDate:(ocidDate)
220  ## ocidFormatterJP's setDateFormat:("年MM月dd日EEEE")
221  ocidFormatterJP's setDateFormat:("年MM月dd日EEEE a hh時mm分ss秒")
222  set ocidDateString to ocidFormatterJP's stringFromDate:(ocidDate)
223  set strDateAndTime to ((ocidDateStringEra as text) & (ocidDateString as text)) as text
224  ###テキストで戻す
225  return strDateAndTime
226end doGetDateNo
AppleScriptで生成しました

|

[Memo]メモアプリ:メモの添付ファイルを保存する(バックアップ用途)


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004# com.cocolog-nifty.quicktimer.icefloe
005----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
006use AppleScript version "2.8"
007use framework "Foundation"
008use framework "AppKit"
009use scripting additions
010property refMe : a reference to current application
011
012
013#保存先の親ディレクトリ
014# ホーム/書類/Apple/Notes
015set appFileManager to refMe's NSFileManager's defaultManager()
016set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDocumentDirectory) inDomains:(refMe's NSUserDomainMask))
017set ocidDocumentDirPathURL to ocidURLsArray's firstObject()
018set ocidParentDirPathURL to ocidDocumentDirPathURL's URLByAppendingPathComponent:("Apple/Notes") isDirectory:(true)
019set appFileManager to refMe's NSFileManager's defaultManager()
020set ocidAttrDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
021(ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions))
022
023
024#######################
025#保存先フォルダ確保
026tell application "Notes"
027  ##全ての添付ファイルを取得
028  set listAttach to every attachment
029end tell
030
031#添付ファイルの数だけ繰り返し
032repeat with itemAttach in listAttach
033  tell application "Notes"
034    tell itemAttach
035      #名前の取得 missing valueの可能性あり
036      set strAttachmentName to name
037      #親構造のプロパティ=ノート
038      set reocrdContainer to container
039      #親構造ノートのID=添付されているノート
040      set strNoteID to id of reocrdContainer
041    end tell
042  end tell
043  #添付ファイル名前の置換
044  #nameがある場合ファイル名として利用するので互換チェックに回す
045  set strAttachmentName to doReplace(strAttachmentName, "_")
046  set strAttachmentName to doReservedFileName(strAttachmentName)
047  
048  tell application "Notes"
049    #親要素のノートを呼び出し
050    tell note id strNoteID
051      #ノートの名称
052      set strNoteName to name
053      #親要素のさらに親=フォルダ要素を取得
054      set reocrdContainer to container
055      #フォルダIDを取得して
056      set strFolderID to id of reocrdContainer
057      
058    end tell
059  end tell
060  #ノート名前のファイル名用互換置換
061  #set strNoteName to doReplace(strNoteName, "_")
062  #set strNoteName to doReservedFileName(strNoteName)
063  
064  
065  tell application "Notes"
066    #フォルダ要素を呼び出し
067    tell folder id strFolderID
068      #フォルダの名前を取得
069      set strFolderName to name
070    end tell
071  end tell
072  #フォルダ名を保存先に使うので
073  #ファイル名の互換チェックに回す
074  set strFolderName to doReplace(strFolderName, "_")
075  set strFolderName to doReservedFileName(strFolderName)
076  
077  #保存先確保
078  set strSetDirName to (strFolderName & "/Attachment") as text
079  set ocidSaveDirPathURL to (ocidParentDirPathURL's URLByAppendingPathComponent:(strSetDirName) isDirectory:(true))
080  #保存先作成
081  set listDone to (appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error| :(reference))
082  
083  
084  #添付ファイルの処理に戻って
085  tell application "Notes"
086    tell itemAttach
087      #URLを取得する
088      set strURL to URL
089    end tell
090  end tell
091  
092  #URLが無い=iCloud保存かローカルにファイルがある
093  if strURL = (missing value) then
094    if strAttachmentName is "missing value" then
095      #iCloudの場合は呼び出し方法がわからない
096    else if strAttachmentName is not "missing value" then
097      #ローカルにファイルがあるなら
098      #保存先パスを作成して
099      set ocidSaveFilePathURL to (ocidSaveDirPathURL's URLByAppendingPathComponent:(strAttachmentName) isDirectory:(false))
100      #FURL=実在しないエイリアスパスにしておく
101      set aliasSaveFilePath to (ocidSaveFilePathURL's absoluteURL()) as «class furl»
102      tell application "Notes"
103        tell itemAttach
104          #上書きしない
105          #同名ファイルがあった場合保存出来ない
106          #必要になったら考えることにする(逃げ)
107          try
108            #添付ファイルを保存
109            save in aliasSaveFilePath
110          end try
111        end tell
112      end tell
113      
114    end if
115  else if strURL ≠ (missing value) then
116    #URLがある=リンク要素で map等のURLの場合に記述される
117    #なぜか?添付ファイル扱いなのでWEBLOCファイルにして保存する
118    set strURL to strURL as text
119    #ファイル名
120    set strSetFileName to (strAttachmentName & ".webloc") as text
121    #保存先URLを作成
122    set ocidSaveFilePathURL to (ocidSaveDirPathURL's URLByAppendingPathComponent:(strSetFileName) isDirectory:(false))
123    #WEBLOC作成のサブへ投げる
124    set boolDone to doMakeWebloc(strURL, ocidSaveFilePathURL)
125  end if
126  
127end repeat
128
129
130#保存先を開く
131set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
132set boolDone to appSharedWorkspace's openURL:(ocidParentDirPathURL)
133
134
135
136#######################
137#WEBLOCを生成して保存
138to doMakeWebloc(argURL, argSaveFileURL)
139  set strURL to argURL as text
140  set ocidURLstr to refMe's NSString's stringWithString:(strURL)
141  set ocidPlistDict to refMe's NSMutableDictionary's alloc()'s init()
142  ocidPlistDict's setValue:(ocidURLstr) forKey:("URL")
143  set ocidFormat to (refMe's NSPropertyListBinaryFormat_v1_0)
144  set listResponse to (refMe's NSPropertyListSerialization's dataWithPropertyList:(ocidPlistDict) format:(ocidFormat) options:0  |error| :(reference))
145  set ocidPlistData to (item 1 of listResponse)
146  set ocidOption to (refMe's NSDataWritingAtomic)
147  set listDone to (ocidPlistData's writeToURL:(argSaveFileURL) options:(ocidOption) |error| :(reference))
148  return (item 1 of listDone)
149end doMakeWebloc
150
151
152
153################################
154# 非互換文字置換
155to doReplace(argOrignalText, argReplaceText)
156  #戻し用のリスト
157  set listReturnText to {} as list
158  #入力をテキストで確定させて
159  set strOrignalText to argOrignalText as text
160  #文字毎でリストにする
161  set listOrignalText to (every text item of strOrignalText) as list
162  ################################
163  #まずは制御文字の削除
164  #文字数分繰り返し
165  repeat with itemOrignalText in listOrignalText
166    #10進ユニコード番号を取得して
167    set strItemCharNO to id of itemOrignalText
168    #濁音等の合成文字は処理しない
169    if (class of strItemCharNO) = integer then
170      #31より小さい数なら制御文字
171      if strItemCharNO ≤ 31 then
172        #10進ユニコード番号31までは制御文字なので削除
173        #なので何もしない
174      else
175        #それ以外の文字は次工程に回す
176        set end of listReturnText to itemOrignalText
177      end if
178      # 合成文字の場合Classがlistになる
179    else if (class of strItemCharNO) = list then
180      #そのまま次工程に回す
181      set end of listReturnText to itemOrignalText
182    end if
183  end repeat
184  
185  ################################
186  #次に指定番号で指定文字に置換
187  #ファイル名パス名のWindow Mac非互換文字と非推奨文字の一部のユニコード10進数値
188  # set listCharNoDec to {34, 37, 42, 47, 58, 60, 62, 63, 92, 94, 124, 126, 127, 160, 165, 8203, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239} as list
189  set listCharNoDec to {34, 37, 42, 47, 58, 60, 62, 63, 92, 94, 124, 126, 127, 160, 165} as list
190  #戻し用のリスト
191  set listSubReturn to {} as list
192  #順番に処理
193  repeat with itemChar in listReturnText
194    #10進ユニコード番号を取得して
195    set strItemCharNO to id of itemChar
196    if listCharNoDec contains strItemCharNO then
197      set end of listSubReturn to argReplaceText
198    else
199      #置換せずにそのまま
200      set end of listSubReturn to itemChar
201    end if
202  end repeat
203  
204  ################################
205  #スペースに置換
206  #ラインセパレータ等特殊文字はスペースに置換する
207  set listCharNoDec to {8203, 8232, 8233, 8234, 8235, 8236, 8237, 8238, 8239} as list
208  #戻し用のリスト
209  set strReturn to ("") as text
210  #順番に処理
211  repeat with itemChar in listSubReturn
212    #10進ユニコード番号を取得して
213    set strItemCharNO to id of itemChar
214    if listCharNoDec contains strItemCharNO then
215      #含まれているならスペース置換
216      #スペース以外の文字に置換する場合はここで変更
217      set strReturn to (strReturn & " ") as text
218    else
219      #置換せずにそのまま
220      set strReturn to (strReturn & itemChar) as text
221    end if
222  end repeat
223  
224  #戻す
225  return strReturn
226end doReplace
227
228
229
230################################
231#予約語置換
232to doReservedFileName(argFileName)
233  #テキストかOCIDかわからないので一度テキストにして
234  set strFileName to argFileName as text
235  #置換テーブル
236  set listReserved to {"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", "CON", "PRN", "AUX", "NUL"} as list
237  set numCntArray to (count of every item of listReserved) as integer
238  #キーの数だけ繰り返し
239  repeat with itemNo from 1 to numCntArray by 1
240    #キーの取得
241    set strKey to (item itemNo of listReserved)
242    #置換デーブルの値を取得
243    set strValue to ("_" & strKey) as text
244    #文字列置換
245    if strFileName is strKey then
246      set strFileName to strValue as text
247    end if
248  end repeat
249  #OCIDで戻す場合
250  # return ocidReplacedStrings
251  #テキストで戻す場合
252  return strFileName as text
253  
254end doReservedFileName
AppleScriptで生成しました

|

[メモ・アプリ]ノートの内容をHTMLでファイルに書き出す

テキストコンテンツがあるノート(添付ファイルや画像は除く)を
HTMLファイルにして保存します。
バックアップ用途として使えます

AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004#全てのノートのバックアップを作成
005#テキスト形式でのバックアップになります
006# 添付ファイルや画像ファイルはバックアップされません
007# nameの値にスペースがあると データとしてはライセンセパレータになる
008# これがちょっと注意点
009# com.cocolog-nifty.quicktimer.icefloe
010----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
011use AppleScript version "2.8"
012use framework "Foundation"
013use framework "AppKit"
014use scripting additions
015property refMe : a reference to current application
016
017
018#######################
019# フォルダの詳細をDICTにする
020set ocidFolderDict to refMe's NSMutableDictionary's alloc()'s init()
021# キーをフォルダID
022# 値をフォルダの名前にする
023tell application "Notes"
024  set listFolder to every folder as list
025  repeat with itemFolder in listFolder
026    tell itemFolder
027      set strFolderID to id as text
028      set strFolderName to name as text
029      set ocidFolderName to (refMe's NSString's stringWithString:(strFolderName))
030      #フォルダ名の禁則処理はカスタマイズしてください
031      set ocidFolderName to (ocidFolderName's stringByReplacingOccurrencesOfString:(":") withString:("_"))
032      (ocidFolderDict's setValue:(ocidFolderName) forKey:(strFolderID))
033    end tell
034  end repeat
035end tell
036
037#######################
038# バックアップ先 書類フォルダ
039set appFileManager to refMe's NSFileManager's defaultManager()
040set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDocumentDirectory) inDomains:(refMe's NSUserDomainMask))
041set ocidDocumentDirPathURL to ocidURLsArray's firstObject()
042set ocidParentDirPathURL to ocidDocumentDirPathURL's URLByAppendingPathComponent:("Apple/Notes") isDirectory:(true)
043#フォルダを作成する
044set ocidFolderAllKeys to ocidFolderDict's allKeys()
045#作成するフォルダのアクセス権
046set appFileManager to refMe's NSFileManager's defaultManager()
047set ocidAttrDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
048(ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions))
049#フォルダの数だけ繰り返し
050repeat with itemKey in ocidFolderAllKeys
051  set ocidFolderName to (ocidFolderDict's valueForKey:(itemKey))
052  set strFolderName to ocidFolderName as text
053  set ocidMakeDirPathURL to (ocidParentDirPathURL's URLByAppendingPathComponent:(strFolderName) isDirectory:(true))
054  set listDone to (appFileManager's createDirectoryAtURL:(ocidMakeDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error| :(reference))
055  if (item 1 of listDone) is false then
056    log (item 2 of listDone)'s code() as string
057    log (item 2 of listDone)'s domain() as string
058    log (item 2 of listDone)'s localizedFailureReason() as string
059    return "保存に失敗しました"
060  end if
061end repeat
062
063#######################
064#本処理
065tell application "Notes"
066  #全てのノートを取得して
067  set listNotes to every note as list
068end tell
069#順番に処理
070repeat with itemNote in listNotes
071  tell application "Notes"
072    tell itemNote
073      #フォルダIDを取得して
074      set recordPorperties to properties
075      set strFolderID to (id of container of recordPorperties) as text
076      #名前
077      set strNoteName to name as text
078      #コンテンツ
079      set strBody to body as text
080    end tell
081  end tell
082  #フォルダ名を調べる
083  set ocidFolderName to (ocidFolderDict's valueForKey:(strFolderID))
084  #テキスト保存先パス
085  set ocidSaveDirPathURL to (ocidParentDirPathURL's URLByAppendingPathComponent:(ocidFolderName) isDirectory:(true))
086  set ocidNoteName to (refMe's NSString's stringWithString:(strNoteName))
087  #ファイル名の禁則処理はカスタマイズしてください
088  set ocidNoteName to (ocidNoteName's stringByReplacingOccurrencesOfString:("\r") withString:(""))
089  set ocidNoteName to (ocidNoteName's stringByReplacingOccurrencesOfString:("\n") withString:(""))
090  set ocidNoteName to (ocidNoteName's stringByReplacingOccurrencesOfString:(":") withString:(""))
091  set ocidNoteName to (ocidNoteName's stringByReplacingOccurrencesOfString:("/") withString:(":"))
092  #ラインセパレーターの置換
093  set listResponse to (refMe's NSRegularExpression's regularExpressionWithPattern:("\\u2028") options:0  |error| :(reference))
094  set appRegex to (item 1 of listResponse)
095  set ocidCharLength to ocidNoteName's |length|()
096  set ocidSetRange to refMe's NSRange's NSMakeRange(0, ocidCharLength)
097  set ocidNoteName to (appRegex's stringByReplacingMatchesInString:(ocidNoteName) options:0 range:(ocidSetRange) withTemplate:(" "))
098  #
099  set ocidSaveBaseFilePathURL to (ocidSaveDirPathURL's URLByAppendingPathComponent:(ocidNoteName) isDirectory:(false))
100  set ocidSaveHtmlFilePathURL to (ocidSaveBaseFilePathURL's URLByAppendingPathExtension:("html"))
101  #HTMLにする
102  set ocidBody to (refMe's NSString's stringWithString:(strBody))
103  set ocidBody to (ocidBody's stringByReplacingOccurrencesOfString:("\n") withString:(""))
104  set ocidBody to (ocidBody's stringByReplacingOccurrencesOfString:("\r") withString:(""))
105  set ocidHTMLstring to doMakeHTML(ocidBody, ocidNoteName)
106  log ocidNoteName as text
107  #書き込み
108  set listDone to (ocidHTMLstring's writeToURL:(ocidSaveHtmlFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error| :(reference))
109  if (item 1 of listDone) is false then
110    log (item 2 of listDone)'s code() as string
111    log (item 2 of listDone)'s domain() as string
112    log (item 2 of listDone)'s localizedFailureReason() as string
113    return "保存に失敗しました"
114  end if
115  
116end repeat
117
118
119#######################
120# 保存先を開く
121set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
122set boolDone to appSharedWorkspace's openURL:(ocidParentDirPathURL)
123
124
125to doMakeHTML(argHTMLtext, argTitleText)
126  set ocidXMLDoc to refMe's NSXMLDocument's alloc()'s init()
127  ocidXMLDoc's setDocumentContentKind:(refMe's NSXMLDocumentHTMLKind)
128  set ocidDTD to refMe's NSXMLDTD's alloc()'s init()
129  ocidDTD's setName:("html")
130  ocidXMLDoc's setDTD:(ocidDTD)
131  set ocidRootElement to refMe's NSXMLElement's elementWithName:("html")
132  set ocidAddNode to refMe's NSXMLNode's attributeWithName:("lang") stringValue:("ja")
133  ocidRootElement's addAttribute:(ocidAddNode)
134  set ocidHeadElement to refMe's NSXMLElement's elementWithName:("head")
135  set ocidAddElement to refMe's NSXMLElement's elementWithName:("title")
136  ocidAddElement's setStringValue:(argTitleText)
137  ocidHeadElement's addChild:(ocidAddElement)
138  set ocidAddElement to refMe's NSXMLElement's elementWithName:("style")
139  ocidAddElement's setStringValue:("body { margin: 10px; background-color: #FFFFFF; }")
140  ocidHeadElement's addChild:(ocidAddElement)
141  ocidRootElement's addChild:(ocidHeadElement)
142  set ocidBodyElement to refMe's NSXMLElement's elementWithName:("body")
143  set listResponse to refMe's NSXMLElement's alloc()'s initWithXMLString:(argHTMLtext) |error| :(reference)
144  set ocidAddElement to (item 1 of listResponse)
145  ocidBodyElement's addChild:(ocidAddElement)
146  ocidRootElement's addChild:(ocidBodyElement)
147  ocidXMLDoc's setRootElement:(ocidRootElement)
148  #
149  set ocidXMLstring to ocidXMLDoc's XMLString()
150  set ocidHTMLstring to ocidXMLstring's stringValue()
151  if (item 1 of listResponse) = (missing value) then
152    set strReplaceText to ("<body>" & argHTMLtext & "</body>") as text
153    set ocidHTMLstring to (ocidHTMLstring's stringByReplacingOccurrencesOfString:("<body></body>") withString:(strReplaceText))
154    return ocidHTMLstring
155  else
156    return ocidHTMLstring
157  end if
158  
159end doMakeHTML
AppleScriptで生成しました

|

[メモアプリ]ノートの内容をテキストでファイルに書き出す

テキストコンテンツがあるノート(添付ファイルや画像は除く)を
テキストファイルにして保存します。
バックアップ用途として使えます

AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#!/usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003#
004#全てのノートのバックアップを作成
005#テキスト形式でのバックアップになります
006# 添付ファイルや画像ファイルはバックアップされません
007# com.cocolog-nifty.quicktimer.icefloe
008----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
009use AppleScript version "2.8"
010use framework "Foundation"
011use framework "AppKit"
012use scripting additions
013property refMe : a reference to current application
014
015
016#######################
017# フォルダの詳細をDICTにする
018set ocidFolderDict to refMe's NSMutableDictionary's alloc()'s init()
019# キーをフォルダID
020# 値をフォルダの名前にする
021tell application "Notes"
022  set listFolder to every folder as list
023  repeat with itemFolder in listFolder
024    tell itemFolder
025      set strFolderID to id as text
026      set strFolderName to name as text
027      set ocidFolderName to (refMe's NSString's stringWithString:(strFolderName))
028      #フォルダ名の禁則処理はカスタマイズしてください
029      set ocidFolderName to (ocidFolderName's stringByReplacingOccurrencesOfString:(":") withString:("_"))
030      (ocidFolderDict's setValue:(ocidFolderName) forKey:(strFolderID))
031    end tell
032  end repeat
033end tell
034
035#######################
036# バックアップ先 書類フォルダ
037set appFileManager to refMe's NSFileManager's defaultManager()
038set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSDocumentDirectory) inDomains:(refMe's NSUserDomainMask))
039set ocidDocumentDirPathURL to ocidURLsArray's firstObject()
040set ocidParentDirPathURL to ocidDocumentDirPathURL's URLByAppendingPathComponent:("Apple/Notes") isDirectory:(true)
041#フォルダを作成する
042set ocidFolderAllKeys to ocidFolderDict's allKeys()
043#作成するフォルダのアクセス権
044set appFileManager to refMe's NSFileManager's defaultManager()
045set ocidAttrDict to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0)
046(ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions))
047#フォルダの数だけ繰り返し
048repeat with itemKey in ocidFolderAllKeys
049  set ocidFolderName to (ocidFolderDict's valueForKey:(itemKey))
050  set strFolderName to ocidFolderName as text
051  set ocidMakeDirPathURL to (ocidParentDirPathURL's URLByAppendingPathComponent:(strFolderName) isDirectory:(true))
052  set listDone to (appFileManager's createDirectoryAtURL:(ocidMakeDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error| :(reference))
053  if (item 1 of listDone) is false then
054    log (item 2 of listDone)'s code() as string
055    log (item 2 of listDone)'s domain() as string
056    log (item 2 of listDone)'s localizedFailureReason() as string
057    return "保存に失敗しました"
058  end if
059end repeat
060
061#######################
062#本処理
063tell application "Notes"
064  #全てのノートを取得して
065  set listNotes to every note as list
066end tell
067#順番に処理
068repeat with itemNote in listNotes
069  tell application "Notes"
070    tell itemNote
071      #フォルダIDを取得して
072      set recordPorperties to properties
073      set strFolderID to (id of container of recordPorperties) as text
074      #名前
075      set strNoteName to name as text
076      #コンテンツ
077      set strPlaintext to plaintext as text
078    end tell
079  end tell
080  #フォルダ名を調べる
081  set ocidFolderName to (ocidFolderDict's valueForKey:(strFolderID))
082  #テキスト保存先パス
083  set ocidSaveDirPathURL to (ocidParentDirPathURL's URLByAppendingPathComponent:(ocidFolderName) isDirectory:(true))
084  set ocidNoteName to (refMe's NSString's stringWithString:(strNoteName))
085  #ファイル名の禁則処理はカスタマイズしてください
086  set ocidNoteName to (ocidNoteName's stringByReplacingOccurrencesOfString:("\r") withString:(""))
087  set ocidNoteName to (ocidNoteName's stringByReplacingOccurrencesOfString:("\n") withString:(""))
088  set ocidNoteName to (ocidNoteName's stringByReplacingOccurrencesOfString:(":") withString:(""))
089  set ocidNoteName to (ocidNoteName's stringByReplacingOccurrencesOfString:("/") withString:(":"))
090  set ocidSaveBaseFilePathURL to (ocidSaveDirPathURL's URLByAppendingPathComponent:(ocidNoteName) isDirectory:(false))
091  set ocidSaveTextFilePathURL to (ocidSaveBaseFilePathURL's URLByAppendingPathExtension:("txt"))
092  set ocidTextData to (refMe's NSString's stringWithString:(strPlaintext))
093  #書き込み
094  set listDone to (ocidTextData's writeToURL:(ocidSaveTextFilePathURL) atomically:(true) encoding:(refMe's NSUTF8StringEncoding) |error| :(reference))
095  if (item 1 of listDone) is false then
096    log (item 2 of listDone)'s code() as string
097    log (item 2 of listDone)'s domain() as string
098    log (item 2 of listDone)'s localizedFailureReason() as string
099    return "保存に失敗しました"
100  end if
101  
102end repeat
103
104
105#######################
106# 保存先を開く
107set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace()
108set boolDone to appSharedWorkspace's openURL:(ocidParentDirPathURL)
109
AppleScriptで生成しました

|

[Notes]選択したメモを別アカウントに複製(新規作成)します

macOS標準のメモアプリ(Notes.app)は
AppleScript上で複製出来ないので
同じ物をAppleScriptを利用して複製する場合は
同じ内容の物を別のアカウントに新規作成することになります

ダウンロード - e981b8e68a9ee38197e3819fe3838ee383bce38388e5908ce38197e38299e38282e381aee38292e588a5e381aee382a2e382abe382a6e383b3e38388e381abe4bd9ce68890e38199e3828b.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.8"
use framework "Foundation"
use scripting additions

####ログを出す場合コメントアウトを外してね
(*
tell application "Script Editor"
tell application "System Events"
keystroke "l" using {command down, option down}
end tell
end tell
delay 1
*)
###選択中のメモを取得
tell application "Notes"
set listSelected to selection
end tell

#####移動先のアカウントを決めてもらう
##アカウントリストを初期化
set listAccountName to {} as list

tell application "Notes"
###アカウントリストを取得
set listAccount to every account as list
set numAccount to (count of listAccount) as number
repeat with objAccount in listAccount
##アカウントを順番に
tell objAccount
###アカウントIDを取得
set objAccountID to id
###アカウント名を取得
set strAccountName to name as text
end tell
###アカウントリストに格納する
copy "" & strAccountName & "" to end of listAccountName
end repeat
end tell

####選択ダイアログを出して
try
set objResponse to (choose from list listAccountName with title "移動先を選択してください" with prompt "移動先先のアカウントを選んでください" default items (item 1 of listAccountName) 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
log "キャンセルしました"
return
end if

set strResponse to objResponse as text

tell application "Notes"
##選択したノートを順番に処理
repeat with objNote in listSelected
###まずは選択したオプジェクトについて
tell objNote
###コンテナ(ここではFolder)を取得
set objFolderName to container
##選択ノートのFolderについて
tell objFolderName
###選択ノートのフォルダ名を取得
set strFolderName to name
###選択ノートのフォルダのコンテナ(ここではAccount
set objAccount to container
###選択ノートのアカウントについて
tell objAccount
###選択ノートのアカウント名を取得
set strAccountrName to name
end tell
end tell
##メモの名前を取得
set strNoteName to name
####本文を取得
#注意
#ボディは『取得』できますが
#ほとんど書き込み出来ません
#これは回避方法がわからなかった
set objBody to body
##添付ファイルを取得『無い場合は{}
set objAttach to every attachment
#plaintextはリードオンリーなので不要
##set objPlaintext to plaintext
end tell
####移動先に同名のフォルダがあるか?確認
set boolFolderExists to exists of folder strFolderName of account strResponse
###フォルダがなければフォルダを作成する
if boolFolderExists is false then
##移動先のアカウント
tell account strResponse
##同名のフォルダを作る
make new folder with properties {name:strFolderName}
end tell
end if
##選択したのアカウント
tell account strResponse
##同名フォルダに新規ノートを作成
set objNewNote to make new note at (folder strFolderName) with properties {name:strNoteName, body:objBody}
end tell
###添付ファイルの処理
set numCntAttach to count objAttach
set numChkCnt to 1
##元のメモに添付のある数だけ処理
repeat numCntAttach times
set objAttachFile to item numChkCnt of objAttach
##添付ファイルのIDを取得
set numAttachID to id of objAttachFile
tell attachment id numAttachID
##パスを取得
set aliasAttachContents to contents
log aliasAttachContents
end tell
##新規添付ファイルを元のパスと同じ物を新規作成したメモに紐づける
make new attachment at objNewNote with data aliasAttachContents
set numChkCnt to numChkCnt + 1
end repeat

end repeat
end tell

|

[Notes]macOSメモアプリの基本

macOS標準のメモアプリ(Notes.app)の
AppleScript的基本構造

tell application "Notes"
-----------------添付ファイルはアカウント等に紐づかない
tell attachment
-->添付されたファイルここ
-->ローカル、クラウドに実態がある
end tell

-----------------ノート(メモ)は
--アカウント-->フォルダ-->ノートの階層構造
tell account
tell folder
tell note
-->ここにメモの本文がある
end tell
end tell
end tell
end tell

なので 各項目で一覧を取得すには こんな感じになります
tell application "Notes"
-----------------添付ファイルはアカウント等に紐づかない
set listAttach to every attachment
tell attachment
-->添付されたファイルここ
-->ローカル、クラウドに実態がある
end tell

-----------------ノート(メモ)は
--アカウント-->フォルダ-->ノートの階層構造
set listAccount to every account
tell account id XXXX
set listFolder to every folder
tell folder id XXXX
set listNote to every note
tell note id XXXX
-->ここにメモの本文がある
end tell
end tell
end tell
end tell

添付ファイルを取得する場合のサンプル

tell application "Notes"
##全ての添付ファイルを取得
set listAttach to every attachment
###添付ファイルのここに処理
repeat with objAttach in listAttach
set numID to id of objAttach
##添付ファイルIDについて
tell attachment id numID
##ファイルのエイリアス
set strAttachContainer to contents
log strAttachContainer
##ファイル名
set strAttachName to name
log strAttachName
##URL
set strAttachURL to URL
log strAttachURL
end tell
end repeat
end tell

|

[Notes]選択したノートを別のアカウントに移動します

macOS標準のメモアプリ(Notes.app)で
選択したメモ(note)を別のアカウントに移動します
同名のフォルダへ移動します。
同名のフォルダが無い場合は同名のフォルダを作ります。


ダウンロード - e981b8e68a9ee38197e3819fe3838ee383bce38388e38292e7a7bbe58b95e38199e3828b.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.8"
use framework "Foundation"
use scripting additions

####ログを出す場合コメントアウトを外してね
(*
tell application "Script Editor"
tell application "System Events"
keystroke "l" using {command down, option down}
end tell
end tell
delay 1
*)



tell application "Notes"
set listSelected to selection
end tell

#####移動先のアカウントを決めてもらう
##アカウントリストを初期化
set listAccountName to {} as list

tell application "Notes"
###アカウントリストを取得
set listAccount to every account as list
set numAccount to (count of listAccount) as number
repeat with objAccount in listAccount
##アカウントを順番に
tell objAccount
###アカウントIDを取得
set objAccountID to id
###アカウント名を取得
set strAccountName to name as text
end tell
###アカウントリストに格納する
copy "" & strAccountName & "" to end of listAccountName
end repeat
end tell

####選択ダイアログを出して
try
set objResponse to (choose from list listAccountName with title "移動先を選択してください" with prompt "移動先先のアカウントを選んでください" default items (item 1 of listAccountName) 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
log "キャンセルしました"
return
end if

set strResponse to objResponse as text

tell application "Notes"
##選択したノートを順番に処理
repeat with objNote in listSelected
###まずは選択したオプジェクトについて
tell objNote
###コンテナ(ここではFolder)を取得
set objFolderName to container
##選択ノートのFolderについて
tell objFolderName
###選択ノートのフォルダ名を取得
set strFolderName to name
###選択ノートのフォルダのコンテナ(ここではAccount
set objAccount to container
###選択ノートのアカウントについて
tell objAccount
###選択ノートのアカウント名を取得
set strAccountrName to name
end tell
end tell
end tell
####移動先に同名のフォルダがあるか?確認
set boolFolderExists to exists of folder strFolderName of account strResponse
###フォルダがなければフォルダを作成する
if boolFolderExists is false then
##移動先のアカウント
tell account strResponse
##同名のフォルダを作る
make new folder with properties {name:strFolderName}
end tell
end if
#####移動します
move objNote to folder strFolderName of account strResponse
end repeat
end tell

|

[Notes]個別のnoteはAppleScriptで複製(duplicate)出来ない

macOS標準のメモアプリ(Notes.app)の個別のメモ(note)は
複製出来ません。
移動は出来ます

ダウンロード - e3838ee383bce38388e381afduplicatee587bae69da5e381aae38184.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.8"
use framework "Foundation"
use scripting additions

tell application "Script Editor"
tell application "System Events"
keystroke "l" using {command down, option down}
end tell
end tell
delay 1

tell application "Notes"

set listSelected to selection

set objSelect to item 1 of listSelected
end tell

tell application "Notes"
set objNote to objSelect
tell objNote
set strNoteName to name
set objBody to body
set objPlaintext to plaintext
end tell
duplicate objNote to folder "ID" of account "このMac"
-->error "Notesでエラーが起きました: Notes can not be copied." number -1717
end tell

|

[defaults] com.apple.Notes

~/Library/Containers には『メモ』フォルダが2つあるが
$HOMEa/Library/Containers/com.apple.Notes →こちらが本体
$HOME/Library/Containers/com.apple.Notes.SharingExtension
初期化時に間違えないように

この部分をOFFにします

20220203-125347

ダウンロード - com.apple.notes.zip



--Notesが起動中な場合は一旦終了
tell application "Finder"

tell application "System Events"
set listAppProcess to every application process
end tell
tell application "System Events"
set listAppProcess to name of every application process as list

repeat with objAppProcess in listAppProcess
set objAppProcess to objAppProcess as text
if objAppProcess is "Notes" then
tell application id "com.apple.Notes"
quit saving yes
end tell
end if
end repeat

end tell

end tell
delay 2

--設定を書き込む
set theComandText to ("defaults write com.apple.Notes ShouldPerformTextReplacement -bool false") as text
do shell script theComandText
set theComandText to ("defaults write com.apple.Notes ShouldUseSmartCopyPaste -bool false") as text
do shell script theComandText
set theComandText to ("defaults write com.apple.Notes ShouldUseSmartDashes -bool false") as text
do shell script theComandText
set theComandText to ("defaults write com.apple.Notes ShouldUseSmartLinks -bool false") as text
do shell script theComandText
set theComandText to ("defaults write com.apple.Notes ShouldCorrectSpellingAutomatically -bool false") as text
do shell script theComandText
set theComandText to ("defaults write com.apple.Notes ShouldUseSmartQuotes -bool false") as text
do shell script theComandText
set theComandText to ("defaults write com.apple.Notes ShouldContinuouslyCheckSpelling -bool false") as text
do shell script theComandText



sh

#!/bin/zsh

#

#

#

local thePsPrint=`ps -alx | grep Notes.app | grep -v "grep"| awk '{print $2}' `

echo $thePsPrint


if [ -n "$thePsPrint" ]

then


kill $thePsPrint


fi


defaults write com.apple.Notes ShouldPerformTextReplacement -bool false

defaults write com.apple.Notes ShouldUseSmartCopyPaste -bool false

defaults write com.apple.Notes ShouldUseSmartDashes -bool false

defaults write com.apple.Notes ShouldUseSmartLinks -bool false

defaults write com.apple.Notes ShouldCorrectSpellingAutomatically -bool false

defaults write com.apple.Notes ShouldUseSmartQuotes -bool false

defaults write com.apple.Notes ShouldContinuouslyCheckSpelling -bool false


sleep 2

open /System/Applications/Notes.app/

exit

|

その他のカテゴリー

Accessibility Acrobat Acrobat 2020 Acrobat 2024 Acrobat AddOn Acrobat Annotation Acrobat AppleScript Acrobat ARMDC Acrobat AV2 Acrobat BookMark Acrobat Classic Acrobat DC Acrobat Dialog Acrobat Distiller Acrobat Form Acrobat GentechAI Acrobat JS Acrobat JS Word Search Acrobat Maintenance Acrobat Manifest Acrobat Menu Acrobat Merge Acrobat Open Acrobat PDFPage Acrobat Plugin Acrobat Preferences Acrobat Preflight Acrobat Print Acrobat Python Acrobat Reader Acrobat Reader Localized Acrobat Reference Acrobat Registered Products Acrobat SCA Acrobat SCA Updater Acrobat Sequ Acrobat Sign Acrobat Stamps Acrobat URL List Mac Acrobat URL List Windows Acrobat Watermark Acrobat Windows Acrobat Windows Reader Admin Admin Account Admin Apachectl Admin ConfigCode Admin configCode Admin Device Management Admin LaunchServices Admin Locationd Admin loginitem Admin Maintenance Admin Mobileconfig Admin NetWork Admin Permission Admin Pkg Admin Power Management Admin Printer Admin Printer Basic Admin Printer Custompapers Admin SetUp Admin SMB Admin softwareupdate Admin Support Admin System Information Admin TCC Admin Tools Admin Umask Admin Users Admin Volumes Admin XProtect Adobe Adobe AUSST Adobe Bridge Adobe Documents Adobe FDKO Adobe Fonts Adobe Reference Adobe RemoteUpdateManager Adobe Sap Code AppKit Apple AppleScript AppleScript Duplicate AppleScript entire contents AppleScript List AppleScript ObjC AppleScript Osax AppleScript PDF AppleScript Pictures AppleScript record AppleScript Video Applications AppStore Archive Archive Keka Attributes Automator BackUp Barcode Barcode Decode Barcode QR Bash Basic Basic Path Bluetooth BOX Browser Calendar CD/DVD Choose Chrome Chromedriver CIImage CityCode CloudStorage Color Color NSColor Color NSColorList com.apple.LaunchServices.OpenWith Console Contacts CotEditor CURL current application Date&Time delimiters Desktop Desktop Position Device Diff Disk do shell script Dock Dock Launchpad DropBox Droplet eMail Encode % Encode Decode Encode HTML Entity Encode UTF8 Error EXIFData exiftool ffmpeg File File Name Finder Finder Window Firefox Folder FolderAction Font List FontCollections Fonts Fonts Asset_Font Fonts ATS Fonts Emoji Fonts Maintenance Fonts Morisawa Fonts Python Fonts Variable Foxit GIF github Guide HTML Icon Icon Assets.car Illustrator Image Events ImageOptim Input Dictionary iPhone iWork Javascript Jedit Ω Json Label Language Link locationd lsappinfo m3u8 Mail Map Math Media Media AVAsset Media AVconvert Media AVFoundation Media AVURLAsset Media Movie Media Music Memo Messages Microsoft Microsoft Edge Microsoft Excel Microsoft Fonts Microsoft Office Microsoft Office Link Microsoft OneDrive Microsoft Teams Mouse Music Node Notes NSArray NSArray Sort NSAttributedString NSBezierPath NSBitmapImageRep NSBundle NSCFBoolean NSCharacterSet NSData NSDecimalNumber NSDictionary NSError NSEvent NSFileAttributes NSFileManager NSFileManager enumeratorAtURL NSFont NSFontManager NSGraphicsContext NSGraphicsContext Crop NSImage NSIndex NSKeyedArchiver NSKeyedUnarchiver NSLocale NSMetadataItem NSMutableArray NSMutableDictionary NSMutableString NSNotFound NSNumber NSOpenPanel NSPasteboard NSpoint NSPredicate NSRange NSRect NSRegularExpression NSRunningApplication NSScreen NSSet NSSize NSString NSString stringByApplyingTransform NSStringCompareOptions NSTask NSTimeZone NSUbiquitous NSURL NSURL File NSURLBookmark NSURLComponents NSURLResourceKey NSURLSession NSUserDefaults NSUUID NSView NSWorkspace Numbers OAuth PDF PDF Image2PDF PDF MakePDF PDF nUP PDF Pymupdf PDF Pypdf PDFContext PDFDisplayBox PDFImageRep PDFKit PDFKit Annotation PDFKit AnnotationWidget PDFKit DocumentPermissions PDFKit OCR PDFKit Outline PDFKit Start PDFPage PDFPage Rotation PDFView perl Photoshop PlistBuddy pluginkit plutil postalcode PostScript PowerShell prefPane Preview Python Python eyed3 Python pip QuickLook QuickTime ReadMe Regular Expression Reminders ReName Repeat RTF Safari SaveFile ScreenCapture ScreenSaver Script Editor Script Menu SF Symbols character id SF Symbols Entity Shortcuts Shortcuts Events sips Skype Slack Sound Spotlight sqlite StandardAdditions StationSearch Subtitles LRC Subtitles SRT Subtitles VTT Swift swiftDialog System Events System Settings 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 Weather webarchive webp Wifi Windows XML XML EPUB XML HTML XML LSSharedFileList XML LSSharedFileList sfl2 XML LSSharedFileList sfl3 XML objectsForXQuery XML OPML XML Plist XML Plist System Events XML RSS XML savedSearch XML SVG XML TTML XML webloc XML xmllint XML XMP YouTube Zero Padding zoom