001 | #! /usr/bin/env osascript |
---|
002 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
---|
003 | # |
---|
004 | # 連番画像を生成します |
---|
005 | # ナンバリングスタンプ風に利用できます |
---|
006 | # サンプルPDFはDINAlternate-Boldをフォント指定してあります |
---|
007 | # OS標準搭載ですのでそのままで『たぶん』大丈夫です |
---|
008 | (* テンプレートPDFが必要です |
---|
009 | ダウンドードして利用してください |
---|
010 | https://quicktimer.cocolog-nifty.com/icefloe/files/makenumbering.zip |
---|
011 | *) |
---|
012 | # com.cocolog-nifty.quicktimer.icefloe |
---|
013 | ----+----1----+----2----+-----3----+----4----+----5----+----6----+----7 |
---|
014 | use AppleScript version "2.8" |
---|
015 | use framework "Foundation" |
---|
016 | use framework "AppKit" |
---|
017 | use framework "PDFKit" |
---|
018 | use scripting additions |
---|
019 | |
---|
020 | property refMe : a reference to current application |
---|
021 | |
---|
022 | |
---|
023 | on run argNo |
---|
024 | ################################ |
---|
025 | #設定項目 接頭語 |
---|
026 | set strPrefixText to ("P") as text |
---|
027 | #テンプレート |
---|
028 | set strTemplateFileName to ("144x36.pdf") as text |
---|
029 | #最大印字文字数 |
---|
030 | set numMaxStr to 7 as integer |
---|
031 | |
---|
032 | ################################ |
---|
033 | #ナンバリング桁数 |
---|
034 | set numCntNumbering to (numMaxStr - (count character of strPrefixText)) as integer |
---|
035 | #on runのwith parametersを取得 |
---|
036 | set strArgClass to (class of argNo) as text |
---|
037 | #with parametersが無い場合classがscriptになるので |
---|
038 | #最初の番号 |
---|
039 | if strArgClass is "script" then |
---|
040 | #初回は1から |
---|
041 | set strDefaultAnswer to 1 as integer |
---|
042 | else |
---|
043 | #with parametersがある場合はwith parametersの次の番号 |
---|
044 | set strDefaultAnswer to (argNo + 1) as integer |
---|
045 | end if |
---|
046 | #ダイアログを前面に出す |
---|
047 | set strName to (name of current application) as text |
---|
048 | if strName is "osascript" then |
---|
049 | tell application "Finder" to activate |
---|
050 | else |
---|
051 | tell current application to activate |
---|
052 | end if |
---|
053 | set aliasIconPath to POSIX file "/System/Applications/Calculator.app/Contents/Resources/AppIcon.icns" as alias |
---|
054 | try |
---|
055 | set recordResponse to (display dialog "ナンバリングの最初の番号を入力" with title "入力してください" default answer strDefaultAnswer buttons {"OK", "キャンセル"} default button "OK" cancel button "キャンセル" with icon aliasIconPath giving up after 60 without hidden answer) |
---|
056 | on error |
---|
057 | log "エラーしました" |
---|
058 | return "エラーしました" |
---|
059 | end try |
---|
060 | if true is equal to (gave up of recordResponse) then |
---|
061 | return "時間切れですやりなおしてください" |
---|
062 | end if |
---|
063 | if "OK" is equal to (button returned of recordResponse) then |
---|
064 | set strResponse to (text returned of recordResponse) as text |
---|
065 | else |
---|
066 | log "キャンセルしました" |
---|
067 | return "キャンセルしました" |
---|
068 | end if |
---|
069 | ################################ |
---|
070 | #桁数チェック |
---|
071 | set numResponseCntChr to (count character of strResponse) as integer |
---|
072 | if numResponseCntChr > numCntNumbering then |
---|
073 | return "桁数が多過ぎ" |
---|
074 | end if |
---|
075 | ################################ |
---|
076 | #改行とタブを除去 |
---|
077 | set ocidResponse to refMe's NSString's stringWithString:(strResponse) |
---|
078 | set ocidTempString to ocidResponse's stringByReplacingOccurrencesOfString:("\r") withString:("") |
---|
079 | set ocidTempString to ocidTempString's stringByReplacingOccurrencesOfString:("\n") withString:("") |
---|
080 | set ocidTempString to ocidTempString's stringByReplacingOccurrencesOfString:("\t") withString:("") |
---|
081 | ################################ |
---|
082 | #半角にする |
---|
083 | set ocidResponseM to (ocidTempString's stringByApplyingTransform:(refMe's NSStringTransformFullwidthToHalfwidth) |reverse|:false) |
---|
084 | set numResponse to ocidResponseM as integer |
---|
085 | ################################ |
---|
086 | #テンプレート読み込み |
---|
087 | set aliasPathToMe to (path to me) as alias |
---|
088 | tell application "Finder" |
---|
089 | set aliasContainerDirPath to (container of aliasPathToMe) as alias |
---|
090 | set aliasTemplatePdfFilePath to (file strTemplateFileName of folder "Template" of folder aliasContainerDirPath) as alias |
---|
091 | end tell |
---|
092 | #ファイルパス テンプレート |
---|
093 | set strFilePath to (POSIX path of aliasTemplatePdfFilePath) as text |
---|
094 | set ocidFilePathStr to refMe's NSString's stringWithString:(strFilePath) |
---|
095 | set ocidFilePath to ocidFilePathStr's stringByStandardizingPath |
---|
096 | set ocidFilePathURL to refMe's NSURL's alloc()'s initFileURLWithPath:(ocidFilePath) isDirectory:(false) |
---|
097 | ################################ |
---|
098 | #スタンプに使うナンバーを生成 |
---|
099 | #番号を桁そろえ |
---|
100 | set strNumberRingZero to doAddLeadingZeros(numResponse, numCntNumbering) |
---|
101 | set strSetNo to (strPrefixText & strNumberRingZero) |
---|
102 | |
---|
103 | ################################ |
---|
104 | #PDF テンプレート読み込み |
---|
105 | ###ドキュメント |
---|
106 | set ocidActivDoc to refMe's PDFDocument's alloc()'s initWithURL:ocidFilePathURL |
---|
107 | ###ページ(テンプレートが1ページしかない) |
---|
108 | set ocidActivPage to ocidActivDoc's pageAtIndex:(0) |
---|
109 | ###アノテーション |
---|
110 | set ocidAnnotationArray to ocidActivPage's annotations() |
---|
111 | |
---|
112 | ############################################ |
---|
113 | ###事前処理 アノテーションの名前を値をリストに |
---|
114 | ############################################ |
---|
115 | ###初期値 |
---|
116 | set listFormValue to {} as list |
---|
117 | ###アノテーションの数だけ繰り返し |
---|
118 | repeat with itemAnnotation in ocidAnnotationArray |
---|
119 | set strAnnoType to itemAnnotation's type() as text |
---|
120 | log strAnnoType |
---|
121 | log itemAnnotation's annotationKeyValues() as record |
---|
122 | |
---|
123 | ###対象はWidget |
---|
124 | if strAnnoType is "Widget" then |
---|
125 | log "Widget=フォーム注釈annotation" |
---|
126 | log itemAnnotation's widgetStringValue() as text |
---|
127 | #Widgetの名称を取得して |
---|
128 | set strFieldName to itemAnnotation's fieldName() as text |
---|
129 | if strFieldName contains "NUMBERING" then |
---|
130 | #1の項目には上段の値を入れる |
---|
131 | (itemAnnotation's setWidgetStringValue:(strSetNo)) |
---|
132 | end if |
---|
133 | else |
---|
134 | log "Widget=フォームではない通常の注釈annotation" |
---|
135 | end if |
---|
136 | end repeat |
---|
137 | |
---|
138 | |
---|
139 | ################################ |
---|
140 | #スタンプのテンプレートデータのCROP RECT(使わなかった) |
---|
141 | set listCropRect to (ocidActivPage's boundsForBox:(refMe's kPDFDisplayBoxCropBox)) |
---|
142 | set listRectSize to (item 2 of listCropRect) |
---|
143 | set numCropW to (item 1 of listRectSize) |
---|
144 | set numCropH to (item 2 of listRectSize) |
---|
145 | |
---|
146 | ################################ |
---|
147 | #取り出したページをDATAにして |
---|
148 | set ocidPageData to ocidActivPage's dataRepresentation() |
---|
149 | #NSIMAGEでにする |
---|
150 | set ocidPageImage to refMe's NSImage's alloc()'s initWithData:(ocidPageData) |
---|
151 | #サイズを取得(ポイントサイズ) |
---|
152 | set ocidPDFPageSize to ocidPageImage's |size|() |
---|
153 | set numImageW to ocidPDFPageSize's width |
---|
154 | set numImageH to ocidPDFPageSize's height |
---|
155 | #ポイントサイズを指定する(解像度変更したい場合はここで) |
---|
156 | #出力イメージポイントサイズ |
---|
157 | set ocidSetSize to refMe's NSSize's NSMakeSize(144, 36) |
---|
158 | #PDFページにサイズをセット(意味ないけど) |
---|
159 | ocidPageImage's setSize:(ocidSetSize) |
---|
160 | #DATAに変換 |
---|
161 | set ocidImageRepArray to ocidPageImage's representations() |
---|
162 | #最初の項目がPDFImageRep |
---|
163 | set ocidImageRep to ocidImageRepArray's firstObject() |
---|
164 | #しつこくサイズをセット(意味ないけど) |
---|
165 | (ocidImageRep's setSize:(ocidSetSize)) |
---|
166 | |
---|
167 | ################################ |
---|
168 | #出力用画像作成 |
---|
169 | #出力用BitmapImageRep 透過画像 |
---|
170 | set ocidAardboardRep to (refMe's NSBitmapImageRep's alloc()'s initWithBitmapDataPlanes:(missing value) pixelsWide:(144) pixelsHigh:(36) bitsPerSample:8 samplesPerPixel:4 hasAlpha:true isPlanar:false colorSpaceName:(refMe's NSCalibratedRGBColorSpace) bitmapFormat:(refMe's NSBitmapFormatAlphaFirst) bytesPerRow:0 bitsPerPixel:32) |
---|
171 | #NSGraphicsContext初期化 |
---|
172 | set appGraphicsContext to (refMe's NSGraphicsContext) |
---|
173 | #編集開始 |
---|
174 | appGraphicsContext's saveGraphicsState() |
---|
175 | ##出力イメージ透過画像を処理内に読み込んで |
---|
176 | set ocidContext to appGraphicsContext's graphicsContextWithBitmapImageRep:(ocidAardboardRep) |
---|
177 | appGraphicsContext's setCurrentContext:(ocidContext) |
---|
178 | #テンプレートイメージからの読み込みRECT |
---|
179 | set ocidFromRect to refMe's NSRect's NSMakeRect(0, 0, numImageW, numImageH) |
---|
180 | #透過画像に対しての貼り付け位置のRECT |
---|
181 | set ocidDrawingRect to refMe's NSRect's NSMakeRect(0, 0, 144, 36) |
---|
182 | #透過画像の上にPDFIMAGEREPを貼り付ける |
---|
183 | (ocidImageRep's drawInRect:(ocidDrawingRect) fromRect:(ocidFromRect) operation:(refMe's NSCompositingOperationSourceOver) fraction:1.0 respectFlipped:false hints:(missing value)) |
---|
184 | #編集終了 |
---|
185 | appGraphicsContext's restoreGraphicsState() |
---|
186 | |
---|
187 | |
---|
188 | ################################ |
---|
189 | #PNGデータに変換 |
---|
190 | set ocidProperty to (refMe's NSMutableDictionary's alloc()'s initWithCapacity:0) |
---|
191 | (ocidProperty's setObject:(refMe's NSNumber's numberWithBool:false) forKey:(refMe's NSImageInterlaced)) |
---|
192 | (ocidProperty's setObject:(refMe's NSNumber's numberWithDouble:(1 / 2.2)) forKey:(refMe's NSImageGamma)) |
---|
193 | set ocidPngImageData to (ocidAardboardRep's representationUsingType:(refMe's NSBitmapImageFileTypePNG) |properties|:(ocidProperty)) |
---|
194 | |
---|
195 | ################################ |
---|
196 | #ファイルにしておく |
---|
197 | #保存先 再起動時に削除される項目 |
---|
198 | set appFileManager to refMe's NSFileManager's defaultManager() |
---|
199 | set appFileManager to refMe's NSFileManager's defaultManager() |
---|
200 | set ocidTempDirURL to appFileManager's temporaryDirectory() |
---|
201 | set ocidUUID to refMe's NSUUID's alloc()'s init() |
---|
202 | set ocidUUIDString to ocidUUID's UUIDString |
---|
203 | set ocidSaveDirPathURL to ocidTempDirURL's URLByAppendingPathComponent:(ocidUUIDString) isDirectory:(true) |
---|
204 | #フォルダ生成 |
---|
205 | set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0 |
---|
206 | ocidAttrDict's setValue:(511) forKey:(refMe's NSFilePosixPermissions) |
---|
207 | set listDone to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error| :(reference) |
---|
208 | if (item 1 of listDone) is true then |
---|
209 | # log "正常処理" |
---|
210 | else if (item 2 of listDone) ≠ (missing value) then |
---|
211 | set strErrorNO to (item 2 of listDone)'s code() as text |
---|
212 | set strErrorMes to (item 2 of listDone)'s localizedDescription() as text |
---|
213 | refMe's NSLog("■:" & strErrorNO & strErrorMes) |
---|
214 | return "エラーしました" & strErrorNO & strErrorMes |
---|
215 | end if |
---|
216 | #パス |
---|
217 | set ocidSaveBaseFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:(strSetNo) isDirectory:(false) |
---|
218 | set ocidSaveFilePathURL to ocidSaveBaseFilePathURL's URLByAppendingPathExtension:("png") |
---|
219 | ################################ |
---|
220 | #保存 |
---|
221 | set ocidOption to (refMe's NSDataWritingAtomic) |
---|
222 | set listDone to ocidPngImageData's writeToURL:(ocidSaveFilePathURL) options:(true) |error| :(reference) |
---|
223 | if (item 1 of listDone) is true then |
---|
224 | # log "正常処理" |
---|
225 | set aliasIconPath to (ocidSaveFilePathURL's absoluteURL()) as alias |
---|
226 | set strFilePathURL to ocidSaveFilePathURL's absoluteString() as text |
---|
227 | else if (item 2 of listDone) ≠ (missing value) then |
---|
228 | set strErrorNO to (item 2 of listDone)'s code() as text |
---|
229 | set strErrorMes to (item 2 of listDone)'s localizedDescription() as text |
---|
230 | refMe's NSLog("■:" & strErrorNO & strErrorMes) |
---|
231 | return "エラーしました" & strErrorNO & strErrorMes |
---|
232 | end if |
---|
233 | |
---|
234 | ################################ |
---|
235 | # |
---|
236 | tell current application |
---|
237 | set strName to name as text |
---|
238 | end tell |
---|
239 | if strName is "osascript" then |
---|
240 | tell application "Finder" |
---|
241 | activate |
---|
242 | end tell |
---|
243 | else |
---|
244 | tell current application |
---|
245 | activate |
---|
246 | end tell |
---|
247 | end if |
---|
248 | set strRawNo to strFilePathURL |
---|
249 | set strMes to "スタンプイメージができました\n右クリックから任意のアプリで開けます" |
---|
250 | try |
---|
251 | set recordResult to (display dialog strMes with title "戻り値です" default answer strRawNo buttons {"クリップボードにコピー", "終了", "ファイルにする"} default button "クリップボードにコピー" cancel button "終了" giving up after 20 with icon aliasIconPath without hidden answer) as record |
---|
252 | # set recordResult to (display dialog strMes with title "戻り値です" default answer strRawNo buttons {"クリップボードにコピー", "終了", "次"} default button "クリップボードにコピー" cancel button "終了" giving up after 20 with icon aliasIconPath without hidden answer) as record |
---|
253 | on error |
---|
254 | return "エラーしました" |
---|
255 | end try |
---|
256 | if (gave up of recordResult) is true then |
---|
257 | return "時間切れです" |
---|
258 | end if |
---|
259 | ################################ |
---|
260 | #自分自身を再実行 |
---|
261 | if button returned of recordResult is "次" then |
---|
262 | tell application "Finder" |
---|
263 | set aliasPathToMe to (path to me) as alias |
---|
264 | end tell |
---|
265 | run script aliasPathToMe with parameters numResponse |
---|
266 | end if |
---|
267 | ################################ |
---|
268 | #ファイルにする |
---|
269 | if button returned of recordResult is "ファイルにする" then |
---|
270 | set appFileManager to refMe's NSFileManager's defaultManager() |
---|
271 | set ocidURLsArray to (appFileManager's URLsForDirectory:(refMe's NSPicturesDirectory) inDomains:(refMe's NSUserDomainMask)) |
---|
272 | set ocidPicturesDirPathURL to ocidURLsArray's firstObject() |
---|
273 | set ocidSaveDirPathURL to ocidPicturesDirPathURL's URLByAppendingPathComponent:("Stamp") isDirectory:(true) |
---|
274 | #フォルダ生成 |
---|
275 | set ocidAttrDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0 |
---|
276 | ocidAttrDict's setValue:(448) forKey:(refMe's NSFilePosixPermissions) |
---|
277 | set listDone to appFileManager's createDirectoryAtURL:(ocidSaveDirPathURL) withIntermediateDirectories:true attributes:(ocidAttrDict) |error| :(reference) |
---|
278 | if (item 1 of listDone) is true then |
---|
279 | # log "正常処理" |
---|
280 | else if (item 2 of listDone) ≠ (missing value) then |
---|
281 | set strErrorNO to (item 2 of listDone)'s code() as text |
---|
282 | set strErrorMes to (item 2 of listDone)'s localizedDescription() as text |
---|
283 | refMe's NSLog("■:" & strErrorNO & strErrorMes) |
---|
284 | return "エラーしました" & strErrorNO & strErrorMes |
---|
285 | end if |
---|
286 | #パス |
---|
287 | #set strSaveFileName to (strDateText & "-" & strUpperText) |
---|
288 | set ocidStampBaseFilePathURL to ocidSaveDirPathURL's URLByAppendingPathComponent:(strSetNo) isDirectory:(false) |
---|
289 | set ocidStampFilePathURL to ocidStampBaseFilePathURL's URLByAppendingPathExtension:("png") |
---|
290 | ##移動(コピーじゃなく移動しちゃう) |
---|
291 | set listDone to (appFileManager's moveItemAtURL:(ocidSaveFilePathURL) toURL:(ocidStampFilePathURL) |error| :(reference)) |
---|
292 | if (item 1 of listDone) is true then |
---|
293 | log "正常処理" |
---|
294 | else if (item 2 of listDone) ≠ (missing value) then |
---|
295 | set strErrorNO to (item 2 of listDone)'s code() as text |
---|
296 | set strErrorMes to (item 2 of listDone)'s localizedDescription() as text |
---|
297 | refMe's NSLog("■:" & strErrorNO & strErrorMes) |
---|
298 | #すでにある場合もあるのでエラーで止めない |
---|
299 | log "エラーしました" & strErrorNO & strErrorMes |
---|
300 | end if |
---|
301 | #移動先を開く |
---|
302 | set appSharedWorkspace to refMe's NSWorkspace's sharedWorkspace() |
---|
303 | set boolDone to appSharedWorkspace's openURL:(ocidSaveDirPathURL) |
---|
304 | if boolDone is true then |
---|
305 | log "正常処理" |
---|
306 | else if boolDone is false then |
---|
307 | return "エラーしました" |
---|
308 | end if |
---|
309 | tell application "Finder" |
---|
310 | set aliasPathToMe to (path to me) as alias |
---|
311 | end tell |
---|
312 | run script aliasPathToMe with parameters numResponse |
---|
313 | end if |
---|
314 | ################################ |
---|
315 | #クリップボードに格納 |
---|
316 | if button returned of recordResult is "クリップボードにコピー" then |
---|
317 | set appPasteboard to refMe's NSPasteboard's generalPasteboard() |
---|
318 | appPasteboard's clearContents() |
---|
319 | appPasteboard's setData:(ocidPngImageData) forType:(refMe's NSPasteboardTypePNG) |
---|
320 | #次 |
---|
321 | tell application "Finder" |
---|
322 | set aliasPathToMe to (path to me) as alias |
---|
323 | end tell |
---|
324 | run script aliasPathToMe with parameters numResponse |
---|
325 | end if |
---|
326 | end run |
---|
327 | |
---|
328 | |
---|
329 | ################################ |
---|
330 | #リーディングゼロ |
---|
331 | ################################ |
---|
332 | |
---|
333 | on doAddLeadingZeros(argNo, argAddZeros) |
---|
334 | #渡された数値 |
---|
335 | set numArgNo to argNo as integer |
---|
336 | set strArgNo to argNo as text |
---|
337 | #渡された桁数に10のべき乗 |
---|
338 | set numArgAddZeros to argAddZeros as integer |
---|
339 | set numThresholdDigits to (10 ^ argAddZeros) as integer |
---|
340 | #渡された数値が小さければ0を付与する処理をする |
---|
341 | if numArgNo < numThresholdDigits then |
---|
342 | #戻し値用のテキストを初期化 |
---|
343 | set strLeadingZeros to ("") as text |
---|
344 | #渡された数値の桁数を数える |
---|
345 | set numCntLength to (length of strArgNo) as integer |
---|
346 | #追加する0の数 |
---|
347 | set numAddZero to (numArgAddZeros - numCntLength) as integer |
---|
348 | #戻し値用のテキストに↑の数だけ0を追加 |
---|
349 | repeat numAddZero times |
---|
350 | set strLeadingZeros to (strLeadingZeros & "0") as text |
---|
351 | end repeat |
---|
352 | #戻し値用の0に渡された値を並べてテキストで戻す |
---|
353 | set strArgNo to (strLeadingZeros & strArgNo) as text |
---|
354 | return strArgNo |
---|
355 | else |
---|
356 | #処理不要ならそのままテキストで戻す |
---|
357 | return strArgNo as text |
---|
358 | end if |
---|
359 | end doAddLeadingZeros |
---|
360 | |
---|
361 | |
---|
362 | |
---|
363 | ################################ |
---|
364 | # 日付 doGetDateNo() |
---|
365 | ################################ |
---|
366 | to doGetDateNo() |
---|
367 | #戻す日付テキスト |
---|
368 | set ocidRetuenString to refMe's NSMutableString's alloc()'s initWithCapacity:(0) |
---|
369 | ###今日 |
---|
370 | set ocidDate to (current application's NSDate's |date|()) |
---|
371 | ###フォーマット初期化 |
---|
372 | set ocidFormatterJP to current application's NSDateFormatter's alloc()'s init() |
---|
373 | ###日本のカレンダー |
---|
374 | set ocidCalendarID to (current application's NSCalendarIdentifierJapanese) |
---|
375 | set ocidCalendarJP to current application's NSCalendar's alloc()'s initWithCalendarIdentifier:(ocidCalendarID) |
---|
376 | ###東京タイムゾーン |
---|
377 | set ocidTimezoneJP to current application's NSTimeZone's alloc()'s initWithName:("Asia/Tokyo") |
---|
378 | ###日本語 |
---|
379 | set ocidLocaleJP to current application's NSLocale's alloc()'s initWithLocaleIdentifier:("ja_JP_POSIX") |
---|
380 | ###フォーマットをセット(年号) |
---|
381 | ocidFormatterJP's setTimeZone:(ocidTimezoneJP) |
---|
382 | ocidFormatterJP's setLocale:(ocidLocaleJP) |
---|
383 | ocidFormatterJP's setCalendar:(ocidCalendarJP) |
---|
384 | ocidFormatterJP's setDateStyle:(current application's NSDateFormatterFullStyle) |
---|
385 | set strDateFormat to ("㋿y年") |
---|
386 | ocidFormatterJP's setDateFormat:(strDateFormat) |
---|
387 | set ocidDateStringEra to ocidFormatterJP's stringFromDate:(ocidDate) |
---|
388 | ocidRetuenString's appendString:(ocidDateStringEra) |
---|
389 | ###フォマットから月合字を取得(使わない) |
---|
390 | set recordMonth to {|01月|:"㋀", |02月|:"㋁", |03月|:"㋂", |04月|:"㋃", |05月|:"㋄", |06月|:"㋅", |07月|:"㋆", |08月|:"㋇", |09月|:"㋈", |10月|:"㋉", |11月|:"㋊", |12月|:"㋋"} as record |
---|
391 | set ocidMonthDict to refMe's NSMutableDictionary's alloc()'s initWithDictionary:(recordMonth) |
---|
392 | set strDateFormat to ("MM月") |
---|
393 | ocidFormatterJP's setDateFormat:(strDateFormat) |
---|
394 | set ocidDateStringMonth to ocidFormatterJP's stringFromDate:(ocidDate) |
---|
395 | # set ocidMonthValue to ocidMonthDict's valueForKey:(ocidDateStringMonth) |
---|
396 | ocidRetuenString's appendString:(ocidDateStringMonth) |
---|
397 | ##フォーマットから日付を取得(使わない) |
---|
398 | set recordDate to {|01|:"㏠", |02|:"㏡", |03|:"㏢", |04|:"㏣", |05|:"㏤", |06|:"㏥", |07|:"㏦", |08|:"㏧", |09|:"㏨", |10|:"㏩", |11|:"㏪", |12|:"㏫", |13|:"㏬", |14|:"㏭", |15|:"㏮", |16|:"㏯", |17|:"㏰", |18|:"㏱", |19|:"㏲", |20|:"㏳", |21|:"㏴", |22|:"㏵", |23|:"㏶", |24|:"㏷", |25|:"㏸", |26|:"㏹", |27|:"㏺", |28|:"㏻", |29|:"㏼", |30|:"㏽", |31|:"㏾"} as record |
---|
399 | set ocidDateDict to refMe's NSMutableDictionary's alloc()'s initWithDictionary:(recordDate) |
---|
400 | set strDateFormat to ("dd日") |
---|
401 | # set strDateFormat to ("dd") |
---|
402 | ocidFormatterJP's setDateFormat:(strDateFormat) |
---|
403 | set ocidDateStringDate to ocidFormatterJP's stringFromDate:(ocidDate) |
---|
404 | ocidRetuenString's appendString:(ocidDateStringDate) |
---|
405 | # set ocidDateValue to ocidDateDict's valueForKey:(ocidDateStringDate) |
---|
406 | # ocidRetuenString's appendString:(ocidDateValue) |
---|
407 | |
---|
408 | |
---|
409 | set strDateAndTime to ((ocidRetuenString as text)) as text |
---|
410 | ###テキストで戻す |
---|
411 | return strDateAndTime |
---|
412 | end doGetDateNo |
---|