AppleScript record

HEX8進キー DEC10進値 のレコード 小文字


サンプルコード

サンプルソース(参考)
行番号ソース
001set recordHexToDecSmall to {|00|:"0", |01|:"1", |02|:"2", |03|:"3", |04|:"4", |05|:"5", |06|:"6", |07|:"7", |08|:"8", |09|:"9", |0a|:"10", |0b|:"11", |0c|:"12", |0d|:"13", |0e|:"14", |0f|:"15", |10|:"16", |11|:"17", |12|:"18", |13|:"19", |14|:"20", |15|:"21", |16|:"22", |17|:"23", |18|:"24", |19|:"25", |1a|:"26", |1b|:"27", |1c|:"28", |1d|:"29", |1e|:"30", |1f|:"31", |20|:"32", |21|:"33", |22|:"34", |23|:"35", |24|:"36", |25|:"37", |26|:"38", |27|:"39", |28|:"40", |29|:"41", |2a|:"42", |2b|:"43", |2c|:"44", |2d|:"45", |2e|:"46", |2f|:"47", |30|:"48", |31|:"49", |32|:"50", |33|:"51", |34|:"52", |35|:"53", |36|:"54", |37|:"55", |38|:"56", |39|:"57", |3a|:"58", |3b|:"59", |3c|:"60", |3d|:"61", |3e|:"62", |3f|:"63", |40|:"64", |41|:"65", |42|:"66", |43|:"67", |44|:"68", |45|:"69", |46|:"70", |47|:"71", |48|:"72", |49|:"73", |4a|:"74", |4b|:"75", |4c|:"76", |4d|:"77", |4e|:"78", |4f|:"79", |50|:"80", |51|:"81", |52|:"82", |53|:"83", |54|:"84", |55|:"85", |56|:"86", |57|:"87", |58|:"88", |59|:"89", |5a|:"90", |5b|:"91", |5c|:"92", |5d|:"93", |5e|:"94", |5f|:"95", |60|:"96", |61|:"97", |62|:"98", |63|:"99", |64|:"100", |65|:"101", |66|:"102", |67|:"103", |68|:"104", |69|:"105", |6a|:"106", |6b|:"107", |6c|:"108", |6d|:"109", |6e|:"110", |6f|:"111", |70|:"112", |71|:"113", |72|:"114", |73|:"115", |74|:"116", |75|:"117", |76|:"118", |77|:"119", |78|:"120", |79|:"121", |7a|:"122", |7b|:"123", |7c|:"124", |7d|:"125", |7e|:"126", |7f|:"127", |80|:"128", |81|:"129", |82|:"130", |83|:"131", |84|:"132", |85|:"133", |86|:"134", |87|:"135", |88|:"136", |89|:"137", |8a|:"138", |8b|:"139", |8c|:"140", |8d|:"141", |8e|:"142", |8f|:"143", |90|:"144", |91|:"145", |92|:"146", |93|:"147", |94|:"148", |95|:"149", |96|:"150", |97|:"151", |98|:"152", |99|:"153", |9a|:"154", |9b|:"155", |9c|:"156", |9d|:"157", |9e|:"158", |9f|:"159", a0:"160", a1:"161", a2:"162", a3:"163", a4:"164", a5:"165", a6:"166", a7:"167", a8:"168", a9:"169", aa:"170", ab:"171", ac:"172", ad:"173", ae:"174", af:"175", b0:"176", b1:"177", b2:"178", b3:"179", b4:"180", b5:"181", b6:"182", b7:"183", b8:"184", b9:"185", ba:"186", bb:"187", bc:"188", bd:"189", be:"190", bf:"191", c0:"192", c1:"193", c2:"194", c3:"195", c4:"196", c5:"197", c6:"198", c7:"199", c8:"200", c9:"201", ca:"202", cb:"203", cc:"204", cd:"205", ce:"206", cf:"207", d0:"208", d1:"209", d2:"210", d3:"211", d4:"212", d5:"213", d6:"214", d7:"215", d8:"216", d9:"217", da:"218", db:"219", dc:"220", dd:"221", de:"222", df:"223", e0:"224", e1:"225", e2:"226", e3:"227", e4:"228", e5:"229", e6:"230", e7:"231", e8:"232", e9:"233", ea:"234", eb:"235", ec:"236", ed:"237", ee:"238", ef:"239", f0:"240", f1:"241", f2:"242", f3:"243", f4:"244", f5:"245", f6:"246", f7:"247", f8:"248", f9:"249", fa:"250", fb:"251", fc:"252", fd:"253", fe:"254", ff:"255"} as record
AppleScriptで生成しました

|

HEX8進キー DEC10進値 のレコード 大文字


サンプルコード

サンプルソース(参考)
行番号ソース
001set recordHexToDecCaps to {|00|:"0", |01|:"1", |02|:"2", |03|:"3", |04|:"4", |05|:"5", |06|:"6", |07|:"7", |08|:"8", |09|:"9", |0A|:"10", |0B|:"11", |0C|:"12", |0D|:"13", |0E|:"14", |0F|:"15", |10|:"16", |11|:"17", |12|:"18", |13|:"19", |14|:"20", |15|:"21", |16|:"22", |17|:"23", |18|:"24", |19|:"25", |1A|:"26", |1B|:"27", |1C|:"28", |1D|:"29", |1E|:"30", |1F|:"31", |20|:"32", |21|:"33", |22|:"34", |23|:"35", |24|:"36", |25|:"37", |26|:"38", |27|:"39", |28|:"40", |29|:"41", |2A|:"42", |2B|:"43", |2C|:"44", |2D|:"45", |2E|:"46", |2F|:"47", |30|:"48", |31|:"49", |32|:"50", |33|:"51", |34|:"52", |35|:"53", |36|:"54", |37|:"55", |38|:"56", |39|:"57", |3A|:"58", |3B|:"59", |3C|:"60", |3D|:"61", |3E|:"62", |3F|:"63", |40|:"64", |41|:"65", |42|:"66", |43|:"67", |44|:"68", |45|:"69", |46|:"70", |47|:"71", |48|:"72", |49|:"73", |4A|:"74", |4B|:"75", |4C|:"76", |4D|:"77", |4E|:"78", |4F|:"79", |50|:"80", |51|:"81", |52|:"82", |53|:"83", |54|:"84", |55|:"85", |56|:"86", |57|:"87", |58|:"88", |59|:"89", |5A|:"90", |5B|:"91", |5C|:"92", |5D|:"93", |5E|:"94", |5F|:"95", |60|:"96", |61|:"97", |62|:"98", |63|:"99", |64|:"100", |65|:"101", |66|:"102", |67|:"103", |68|:"104", |69|:"105", |6A|:"106", |6B|:"107", |6C|:"108", |6D|:"109", |6E|:"110", |6F|:"111", |70|:"112", |71|:"113", |72|:"114", |73|:"115", |74|:"116", |75|:"117", |76|:"118", |77|:"119", |78|:"120", |79|:"121", |7A|:"122", |7B|:"123", |7C|:"124", |7D|:"125", |7E|:"126", |7F|:"127", |80|:"128", |81|:"129", |82|:"130", |83|:"131", |84|:"132", |85|:"133", |86|:"134", |87|:"135", |88|:"136", |89|:"137", |8A|:"138", |8B|:"139", |8C|:"140", |8D|:"141", |8E|:"142", |8F|:"143", |90|:"144", |91|:"145", |92|:"146", |93|:"147", |94|:"148", |95|:"149", |96|:"150", |97|:"151", |98|:"152", |99|:"153", |9A|:"154", |9B|:"155", |9C|:"156", |9D|:"157", |9E|:"158", |9F|:"159", A0:"160", A1:"161", A2:"162", A3:"163", A4:"164", A5:"165", A6:"166", A7:"167", A8:"168", A9:"169", AA:"170", AB:"171", AC:"172", AD:"173", AE:"174", AF:"175", B0:"176", B1:"177", B2:"178", B3:"179", B4:"180", B5:"181", B6:"182", B7:"183", B8:"184", B9:"185", BA:"186", BB:"187", BC:"188", BD:"189", BE:"190", BF:"191", C0:"192", C1:"193", C2:"194", C3:"195", C4:"196", C5:"197", C6:"198", C7:"199", C8:"200", C9:"201", CA:"202", CB:"203", CC:"204", CD:"205", CE:"206", CF:"207", D0:"208", D1:"209", D2:"210", D3:"211", D4:"212", D5:"213", D6:"214", D7:"215", D8:"216", D9:"217", DA:"218", DB:"219", DC:"220", DD:"221", DE:"222", DF:"223", E0:"224", E1:"225", E2:"226", E3:"227", E4:"228", E5:"229", E6:"230", E7:"231", E8:"232", E9:"233", EA:"234", EB:"235", EC:"236", ED:"237", EE:"238", EF:"239", F0:"240", F1:"241", F2:"242", F3:"243", F4:"244", F5:"245", F6:"246", F7:"247", F8:"248", F9:"249", FA:"250", FB:"251", FC:"252", FD:"253", FE:"254", FF:"255"} as record
AppleScriptで生成しました

|

[record]キーと値を入れ替えたのrecordを作成する


AppleScript サンプルコード

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

AppleScript サンプルソース(参考)
行番号ソース
001#! /usr/bin/env osascript
002----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
003# com.cocolog-nifty.quicktimer.icefloe
004#
005----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
006use AppleScript version "2.8"
007use framework "Foundation"
008use framework "AppKit"
009use scripting additions
010
011property refMe : a reference to current application
012
013set record8Bit2Hex to {|0|:"00", |1|:"01", |2|:"02", |3|:"03", |4|:"04", |5|:"05", |6|:"06", |7|:"07", |8|:"08", |9|:"09", |10|:"0A", |11|:"0B", |12|:"0C", |13|:"0D", |14|:"0E", |15|:"0F", |16|:"10", |17|:"11", |18|:"12", |19|:"13", |20|:"14", |21|:"15", |22|:"16", |23|:"17", |24|:"18", |25|:"19", |26|:"1A", |27|:"1B", |28|:"1C", |29|:"1D", |30|:"1E", |31|:"1F", |32|:"20", |33|:"21", |34|:"22", |35|:"23", |36|:"24", |37|:"25", |38|:"26", |39|:"27", |40|:"28", |41|:"29", |42|:"2A", |43|:"2B", |44|:"2C", |45|:"2D", |46|:"2E", |47|:"2F", |48|:"30", |49|:"31", |50|:"32", |51|:"33", |52|:"34", |53|:"35", |54|:"36", |55|:"37", |56|:"38", |57|:"39", |58|:"3A", |59|:"3B", |60|:"3C", |61|:"3D", |62|:"3E", |63|:"3F", |64|:"40", |65|:"41", |66|:"42", |67|:"43", |68|:"44", |69|:"45", |70|:"46", |71|:"47", |72|:"48", |73|:"49", |74|:"4A", |75|:"4B", |76|:"4C", |77|:"4D", |78|:"4E", |79|:"4F", |80|:"50", |81|:"51", |82|:"52", |83|:"53", |84|:"54", |85|:"55", |86|:"56", |87|:"57", |88|:"58", |89|:"59", |90|:"5A", |91|:"5B", |92|:"5C", |93|:"5D", |94|:"5E", |95|:"5F", |96|:"60", |97|:"61", |98|:"62", |99|:"63", |100|:"64", |101|:"65", |102|:"66", |103|:"67", |104|:"68", |105|:"69", |106|:"6A", |107|:"6B", |108|:"6C", |109|:"6D", |110|:"6E", |111|:"6F", |112|:"70", |113|:"71", |114|:"72", |115|:"73", |116|:"74", |117|:"75", |118|:"76", |119|:"77", |120|:"78", |121|:"79", |122|:"7A", |123|:"7B", |124|:"7C", |125|:"7D", |126|:"7E", |127|:"7F", |128|:"80", |129|:"81", |130|:"82", |131|:"83", |132|:"84", |133|:"85", |134|:"86", |135|:"87", |136|:"88", |137|:"89", |138|:"8A", |139|:"8B", |140|:"8C", |141|:"8D", |142|:"8E", |143|:"8F", |144|:"90", |145|:"91", |146|:"92", |147|:"93", |148|:"94", |149|:"95", |150|:"96", |151|:"97", |152|:"98", |153|:"99", |154|:"9A", |155|:"9B", |156|:"9C", |157|:"9D", |158|:"9E", |159|:"9F", |160|:"A0", |161|:"A1", |162|:"A2", |163|:"A3", |164|:"A4", |165|:"A5", |166|:"A6", |167|:"A7", |168|:"A8", |169|:"A9", |170|:"AA", |171|:"AB", |172|:"AC", |173|:"AD", |174|:"AE", |175|:"AF", |176|:"B0", |177|:"B1", |178|:"B2", |179|:"B3", |180|:"B4", |181|:"B5", |182|:"B6", |183|:"B7", |184|:"B8", |185|:"B9", |186|:"BA", |187|:"BB", |188|:"BC", |189|:"BD", |190|:"BE", |191|:"BF", |192|:"C0", |193|:"C1", |194|:"C2", |195|:"C3", |196|:"C4", |197|:"C5", |198|:"C6", |199|:"C7", |200|:"C8", |201|:"C9", |202|:"CA", |203|:"CB", |204|:"CC", |205|:"CD", |206|:"CE", |207|:"CF", |208|:"D0", |209|:"D1", |210|:"D2", |211|:"D3", |212|:"D4", |213|:"D5", |214|:"D6", |215|:"D7", |216|:"D8", |217|:"D9", |218|:"DA", |219|:"DB", |220|:"DC", |221|:"DD", |222|:"DE", |223|:"DF", |224|:"E0", |225|:"E1", |226|:"E2", |227|:"E3", |228|:"E4", |229|:"E5", |230|:"E6", |231|:"E7", |232|:"E8", |233|:"E9", |234|:"EA", |235|:"EB", |236|:"EC", |237|:"ED", |238|:"EE", |239|:"EF", |240|:"F0", |241|:"F1", |242|:"F2", |243|:"F3", |244|:"F4", |245|:"F5", |246|:"F6", |247|:"F7", |248|:"F8", |249|:"F9", |250|:"FA", |251|:"FB", |252|:"FC", |253|:"FD", |254|:"FE", |255|:"FF"} as record
014
015##DICTにして
016set ocid8Bit2HexDict to refMe's NSMutableDictionary's alloc()'s initWithDictionary:(record8Bit2Hex)
017##キー一覧を取り出し
018set ocidAllKeysArray to ocid8Bit2HexDict's allKeys()
019##ソートしておく
020set ocidSortedArray to ocidAllKeysArray's sortedArrayUsingSelector:("localizedStandardCompare:")
021##キーの数
022set numCntKey to ocidSortedArray's |count|() as integer
023##出力用のテキスト
024set strOutPutText to ("") as text
025##キーの数だけ繰り返し
026repeat with itemNo from 0 to (numCntKey - 1) by 1
027  #キーを取り出して
028  set ocidKey to (ocidSortedArray's objectAtIndex:(itemNo))
029  set strKye to ocidKey as text
030  #値を突き合わせて
031  set strValue to (ocid8Bit2HexDict's valueForKey:(ocidKey)) as text
032  #テキスト形式でレコードを作っていく
033  set strItemRecord to ("|" & strValue & "|:\"" & strKye & "\"") as text
034  #最後の項目はカンマ不要
035  if itemNo < (numCntKey - 1) then
036    set strOutPutText to (strOutPutText & strItemRecord & ",") as text
037  else if itemNo = (numCntKey - 1) then
038    set strOutPutText to (strOutPutText & strItemRecord) as text
039  end if
040end repeat
041##積み重ねたテキストを
042##レコード形式にする
043set recordAddNew to (run script "return {" & strOutPutText & "}") as record
044
045log recordAddNew as record
046(*
047{|00|:"0", |01|:"1", |02|:"2", |03|:"3", |04|:"4", |05|:"5", |06|:"6", |07|:"7", |08|:"8", |09|:"9", |0a|:"10", |0b|:"11", |0c|:"12", |0d|:"13", |0e|:"14", |0f|:"15", |10|:"16", |11|:"17", |12|:"18", |13|:"19", |14|:"20", |15|:"21", |16|:"22", |17|:"23", |18|:"24", |19|:"25", |1a|:"26", |1b|:"27", |1c|:"28", |1d|:"29", |1e|:"30", |1f|:"31", |20|:"32", |21|:"33", |22|:"34", |23|:"35", |24|:"36", |25|:"37", |26|:"38", |27|:"39", |28|:"40", |29|:"41", |2a|:"42", |2b|:"43", |2c|:"44", |2d|:"45", |2e|:"46", |2f|:"47", |30|:"48", |31|:"49", |32|:"50", |33|:"51", |34|:"52", |35|:"53", |36|:"54", |37|:"55", |38|:"56", |39|:"57", |3a|:"58", |3b|:"59", |3c|:"60", |3d|:"61", |3e|:"62", |3f|:"63", |40|:"64", |41|:"65", |42|:"66", |43|:"67", |44|:"68", |45|:"69", |46|:"70", |47|:"71", |48|:"72", |49|:"73", |4a|:"74", |4b|:"75", |4c|:"76", |4d|:"77", |4e|:"78", |4f|:"79", |50|:"80", |51|:"81", |52|:"82", |53|:"83", |54|:"84", |55|:"85", |56|:"86", |57|:"87", |58|:"88", |59|:"89", |5a|:"90", |5b|:"91", |5c|:"92", |5d|:"93", |5e|:"94", |5f|:"95", |60|:"96", |61|:"97", |62|:"98", |63|:"99", |64|:"100", |65|:"101", |66|:"102", |67|:"103", |68|:"104", |69|:"105", |6a|:"106", |6b|:"107", |6c|:"108", |6d|:"109", |6e|:"110", |6f|:"111", |70|:"112", |71|:"113", |72|:"114", |73|:"115", |74|:"116", |75|:"117", |76|:"118", |77|:"119", |78|:"120", |79|:"121", |7a|:"122", |7b|:"123", |7c|:"124", |7d|:"125", |7e|:"126", |7f|:"127", |80|:"128", |81|:"129", |82|:"130", |83|:"131", |84|:"132", |85|:"133", |86|:"134", |87|:"135", |88|:"136", |89|:"137", |8a|:"138", |8b|:"139", |8c|:"140", |8d|:"141", |8e|:"142", |8f|:"143", |90|:"144", |91|:"145", |92|:"146", |93|:"147", |94|:"148", |95|:"149", |96|:"150", |97|:"151", |98|:"152", |99|:"153", |9a|:"154", |9b|:"155", |9c|:"156", |9d|:"157", |9e|:"158", |9f|:"159", A0:"160", A1:"161", A2:"162", A3:"163", A4:"164", A5:"165", A6:"166", A7:"167", A8:"168", A9:"169", AA:"170", AB:"171", AC:"172", AD:"173", AE:"174", AF:"175", B0:"176", B1:"177", B2:"178", B3:"179", B4:"180", B5:"181", B6:"182", B7:"183", B8:"184", B9:"185", BA:"186", BB:"187", BC:"188", BD:"189", BE:"190", BF:"191", C0:"192", C1:"193", C2:"194", C3:"195", C4:"196", C5:"197", C6:"198", C7:"199", C8:"200", C9:"201", CA:"202", CB:"203", CC:"204", CD:"205", CE:"206", CF:"207", D0:"208", D1:"209", D2:"210", D3:"211", D4:"212", D5:"213", D6:"214", D7:"215", D8:"216", D9:"217", DA:"218", DB:"219", DC:"220", DD:"221", DE:"222", DF:"223", E0:"224", E1:"225", E2:"226", E3:"227", E4:"228", E5:"229", E6:"230", E7:"231", E8:"232", E9:"233", EA:"234", EB:"235", EC:"236", ED:"237", EE:"238", EF:"239", F0:"240", F1:"241", F2:"242", F3:"243", F4:"244", F5:"245", F6:"246", F7:"247", F8:"248", F9:"249", FA:"250", FB:"251", FC:"252", FD:"253", FE:"254", FF:"255"} as record
048
049*)
AppleScriptで生成しました

|

[TTML]縦書き字幕用 横書き→縦書き置換レコード


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application

set recordH2VDict to {|}|:"︸", |«|:"︽", |-|:"︲", |!|:"︕", |[|:"﹇", |]|:"﹈", |ー|:"︱", |(|:"︵", |)|:"︶", |⟦|:"﹇", |、|:"︑", |⟧|:"﹈", |。|:"︒", |⟨|:"︿", |⟩|:"﹀", |⟪|:"︽", |❬|:"︿", |⟫|:"︾", |…|:"︙", |❭|:"﹀", |<|:"︿", |»|:"︾", |❮|:"︿", |[|:"﹇", |⎡|:"﹁", |〈|:"︿", |>|:"﹀", |〉|:"﹀", |❯|:"﹀", |❰|:"︿", |《|:"︽", |❱|:"﹀", |]|:"﹈", |》|:"︾", |「|:"﹁", |」|:"﹂", |⎦|:"﹂", |『|:"﹃", |』|:"﹄", |【|:"︻", |:|:"︓", |】|:"︼", |;|:"︔", |<|:"︿", |〔|:"︹", |>|:"﹀", |〕|:"︺", |?|:"︖", |〖|:"︗", |〗|:"︘", |‹|:"︿", |›|:"﹀", |{|:"︷"} as record
set ocidH2VDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidH2VDict's setDictionary:(recordH2VDict)



set ocidH2VDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidH2VDict's setValue:("︱") forKey:("ー")
ocidH2VDict's setValue:("︲") forKey:("-")
ocidH2VDict's setValue:("︵") forKey:("(")
ocidH2VDict's setValue:("︶") forKey:(")")
ocidH2VDict's setValue:("︷") forKey:("{")
ocidH2VDict's setValue:("︸") forKey:("}")
ocidH2VDict's setValue:("︹") forKey:("〔")
ocidH2VDict's setValue:("︺") forKey:("〕")
ocidH2VDict's setValue:("︻") forKey:("【")
ocidH2VDict's setValue:("︼") forKey:("】")
ocidH2VDict's setValue:("︗") forKey:("〖")
ocidH2VDict's setValue:("︘") forKey:("〗")
ocidH2VDict's setValue:("︽") forKey:("⟪")
ocidH2VDict's setValue:("︾") forKey:("⟫")
ocidH2VDict's setValue:("︽") forKey:("«")
ocidH2VDict's setValue:("︾") forKey:("»")
ocidH2VDict's setValue:("︽") forKey:("《")
ocidH2VDict's setValue:("︾") forKey:("》")
ocidH2VDict's setValue:("︿") forKey:("<")
ocidH2VDict's setValue:("﹀") forKey:(">")
ocidH2VDict's setValue:("︿") forKey:("‹")
ocidH2VDict's setValue:("﹀") forKey:("›")
ocidH2VDict's setValue:("︿") forKey:("〈")
ocidH2VDict's setValue:("﹀") forKey:("〉")
ocidH2VDict's setValue:("︿") forKey:("⟨")
ocidH2VDict's setValue:("﹀") forKey:("⟩")
ocidH2VDict's setValue:("︿") forKey:("<")
ocidH2VDict's setValue:("﹀") forKey:(">")
ocidH2VDict's setValue:("︿") forKey:("❮")
ocidH2VDict's setValue:("﹀") forKey:("❯")
ocidH2VDict's setValue:("︿") forKey:("❬")
ocidH2VDict's setValue:("﹀") forKey:("❭")
ocidH2VDict's setValue:("︿") forKey:("❰")
ocidH2VDict's setValue:("﹀") forKey:("❱")
ocidH2VDict's setValue:("﹁") forKey:("「")
ocidH2VDict's setValue:("﹂") forKey:("」")
ocidH2VDict's setValue:("﹁") forKey:("⎡")
ocidH2VDict's setValue:("﹂") forKey:("⎦")
ocidH2VDict's setValue:("﹃") forKey:("『")
ocidH2VDict's setValue:("﹄") forKey:("』")
ocidH2VDict's setValue:("﹇") forKey:("[")
ocidH2VDict's setValue:("﹈") forKey:("]")
ocidH2VDict's setValue:("﹇") forKey:("[")
ocidH2VDict's setValue:("﹈") forKey:("]")
ocidH2VDict's setValue:("﹇") forKey:("[")
ocidH2VDict's setValue:("﹈") forKey:("]")
ocidH2VDict's setValue:("﹇") forKey:("⟦")
ocidH2VDict's setValue:("﹈") forKey:("⟧")
ocidH2VDict's setValue:("︐") forKey:("、")
ocidH2VDict's setValue:("︑") forKey:("、")
ocidH2VDict's setValue:("︒") forKey:("。")
ocidH2VDict's setValue:("︓") forKey:(":")
ocidH2VDict's setValue:("︔") forKey:(";")
ocidH2VDict's setValue:("︙") forKey:("…")
ocidH2VDict's setValue:("︕") forKey:("!")
ocidH2VDict's setValue:("︖") forKey:("?")
##
set ocidKeyArray to ocidH2VDict's allKeys()
set listKeyArray to ocidKeyArray as list
log listKeyArray as list
##
set recordH2VDict to ocidH2VDict as record
log recordH2VDict as record



|

[Keynote]用紙サイズ指定で新規ドキュメントを作成する

縦型

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
com.cocolog-nifty.quicktimer.icefloe
*)
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application


set recordPageSizePt to {|Letter|:{612, 792}, |Legal|:{612, 1008}, |Executive|:{522, 756}, |Ledger|:{1224, 792}, |Tabloid|:{792, 1224}, |Screen|:{468, 373}, |AnsiC|:{1224, 1584}, |AnsiD|:{1584, 2448}, |AnsiE|:{2448, 3168}, |AnsiF|:{2016, 2880}, |ARCHA|:{648, 864}, |ARCHB|:{864, 1296}, |ARCHC|:{1296, 1728}, |ARCHD|:{1728, 2592}, |ARCHE|:{2592, 3456}, |ARCHE1|:{2160, 3024}, |ARCHE2|:{1872, 2736}, |ARCHE3|:{1944, 2808}, |A5|:{420, 595.22}, |A4|:{595.22, 842}, |A3|:{842, 1191}, |A2|:{1191, 1684}, |A1|:{1684, 2384}, |A0|:{2384, 3370}, |A4Extra|:{667, 914}, |A3Extra|:{913, 1262}, |OversizeA2|:{1361, 1772}, |OversizeA1|:{1772, 2551}, |OversizeA0|:{2551, 3529}, |ISOB5|:{499, 709}, |ISOB4|:{709, 1001}, |ISOB2|:{1417, 2004}, |ISOB1|:{2004, 2835}, |C5|:{459, 649}, |JISB5|:{516, 729}, |JISB4|:{729, 1032}, |JISB3|:{1032, 1460}, |JISB2|:{1460, 2064}, |JISB1|:{2064, 2920}, |JISB0|:{2920, 4127}, |Oversize92|:{6624, 6624}, |Slide7.5x10|:{540, 720}} as record
#
set ocidPageSizePtDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidPageSizePtDict's setDictionary:(recordPageSizePt)
set ocidAllKeys to ocidPageSizePtDict's allKeys()
#
set ocidPageNameArray to refMe's NSMutableArray's arrayWithArray:(ocidAllKeys)
set ocidDescriptor to refMe's NSSortDescriptor's sortDescriptorWithKey:("self") ascending:(yes) selector:("localizedStandardCompare:")
set ocidDescriptorArray to refMe's NSArray's arrayWithObject:(ocidDescriptor)
set ocidPaperNameArray to ocidPageNameArray's sortedArrayUsingDescriptors:(ocidDescriptorArray)
set listPaperSizeName to ocidPaperNameArray as list
###ダイアログ
set strName to (name of current application) as text
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
try
  set listResponse to (choose from list listPaperSizeName with title "選んでください" with prompt "用紙を選んでください" default items (item 1 of listPaperSizeName) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed) as list
on error
log "エラーしました"
return "エラーしました"
end try
if (item 1 of listResponse) is false then
return "キャンセルしました"
end if
set strResponse to (item 1 of listResponse) as text

#####
set listPaperSizePt to ocidPageSizePtDict's valueForKey:(strResponse)
log listPaperSizePt as list
set intWidthPt to (item 1 of listPaperSizePt) as number
set intHeightPt to (item 2 of listPaperSizePt) as number
#
# set numVar to 25.4 as number
# set numWidthMM to ((intWidthPt / 72) * numVar) as number
# set numHeightMM to ((intHeightPt / 72) * numVar) as number
##

#####キーノートで新規書類を作成する
tell application "Keynote"
activate
  set objNewDocument to (make new document with properties {name:"" & strResponse & "", height:"" & intHeightPt & "", width:"" & intWidthPt & "", slide numbers showing:true, document theme:theme id "Application/21_BasicWhite/Standard"})
end tell


横型

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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
(*
com.cocolog-nifty.quicktimer.icefloe
*)
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

property refMe : a reference to current application


set recordPageSizePt to {|Letter|:{612, 792}, |Legal|:{612, 1008}, |Executive|:{522, 756}, |Ledger|:{1224, 792}, |Tabloid|:{792, 1224}, |Screen|:{468, 373}, |AnsiC|:{1224, 1584}, |AnsiD|:{1584, 2448}, |AnsiE|:{2448, 3168}, |AnsiF|:{2016, 2880}, |ARCHA|:{648, 864}, |ARCHB|:{864, 1296}, |ARCHC|:{1296, 1728}, |ARCHD|:{1728, 2592}, |ARCHE|:{2592, 3456}, |ARCHE1|:{2160, 3024}, |ARCHE2|:{1872, 2736}, |ARCHE3|:{1944, 2808}, |A5|:{420, 595.22}, |A4|:{595.22, 842}, |A3|:{842, 1191}, |A2|:{1191, 1684}, |A1|:{1684, 2384}, |A0|:{2384, 3370}, |A4Extra|:{667, 914}, |A3Extra|:{913, 1262}, |OversizeA2|:{1361, 1772}, |OversizeA1|:{1772, 2551}, |OversizeA0|:{2551, 3529}, |ISOB5|:{499, 709}, |ISOB4|:{709, 1001}, |ISOB2|:{1417, 2004}, |ISOB1|:{2004, 2835}, |C5|:{459, 649}, |JISB5|:{516, 729}, |JISB4|:{729, 1032}, |JISB3|:{1032, 1460}, |JISB2|:{1460, 2064}, |JISB1|:{2064, 2920}, |JISB0|:{2920, 4127}, |Oversize92|:{6624, 6624}, |Slide7.5x10|:{540, 720}} as record
#
set ocidPageSizePtDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidPageSizePtDict's setDictionary:(recordPageSizePt)
set ocidAllKeys to ocidPageSizePtDict's allKeys()
#
set ocidPageNameArray to refMe's NSMutableArray's arrayWithArray:(ocidAllKeys)
set ocidDescriptor to refMe's NSSortDescriptor's sortDescriptorWithKey:("self") ascending:(yes) selector:("localizedStandardCompare:")
set ocidDescriptorArray to refMe's NSArray's arrayWithObject:(ocidDescriptor)
set ocidPaperNameArray to ocidPageNameArray's sortedArrayUsingDescriptors:(ocidDescriptorArray)
set listPaperSizeName to ocidPaperNameArray as list
###ダイアログ
set strName to (name of current application) as text
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
try
  set listResponse to (choose from list listPaperSizeName with title "選んでください" with prompt "用紙を選んでください" default items (item 1 of listPaperSizeName) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed) as list
on error
log "エラーしました"
return "エラーしました"
end try
if (item 1 of listResponse) is false then
return "キャンセルしました"
end if
set strResponse to (item 1 of listResponse) as text

#####
set listPaperSizePt to ocidPageSizePtDict's valueForKey:(strResponse)
log listPaperSizePt as list
set intWidthPt to (item 2 of listPaperSizePt) as number
set intHeightPt to (item 1 of listPaperSizePt) as number
#
# set numVar to 25.4 as number
# set numWidthMM to ((intWidthPt / 72) * numVar) as number
# set numHeightMM to ((intHeightPt / 72) * numVar) as number
##

#####キーノートで新規書類を作成する
tell application "Keynote"
activate
  set objNewDocument to (make new document with properties {name:"" & strResponse & "", height:"" & intHeightPt & "", width:"" & intWidthPt & "", slide numbers showing:true, document theme:theme id "Application/21_BasicWhite/Standard"})
end tell


|

[record] キーと値を入れ替えたレコードを作成する


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.8"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

##
set recordChooser to {|宗谷地方|:"011000", |留萌地方|:"012000", |石狩地方|:"016000", |網走地方|:"013000", |釧路地方|:"014100", |日高地方|:"015000", |檜山地方|:"017000", |青森県|:"020000", |秋田県|:"050000", |岩手県|:"030000", |宮城県|:"040000", |山形県|:"060000", |福島県|:"070000", |茨城県|:"080000", |栃木県|:"090000", |群馬県|:"100000", |埼玉県|:"110000", |東京都|:"130000", |千葉県|:"120000", |神奈川県|:"140000", |長野県|:"200000", |山梨県|:"190000", |静岡県|:"220000", |愛知県|:"230000", |岐阜県|:"210000", |三重県|:"240000", |新潟県|:"150000", |富山県|:"160000", |石川県|:"170000", |福井県|:"180000", |滋賀県|:"250000", |京都府|:"260000", |大阪府|:"270000", |兵庫県|:"280000", |奈良県|:"290000", |和歌山県|:"300000", |岡山県|:"330000", |広島県|:"340000", |島根県|:"320000", |鳥取県|:"310000", |徳島県|:"360000", |香川県|:"370000", |愛媛県|:"380000", |高知県|:"390000", |山口県|:"350000", |福岡県|:"400000", |大分県|:"440000", |長崎県|:"420000", |佐賀県|:"410000", |熊本県|:"430000", |宮崎県|:"450000", |鹿児島県|:"460100", |奄美|:"460040", |沖縄|:"471000", |大東島|:"472000", |宮古島|:"473000", |八重山|:"474000"} as record
##
set ocidOfficeDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
ocidOfficeDict's setDictionary:(recordChooser)
##値=この場合オフィス番号のリストを番号順にソートしておく
set ocidOfficeNoArray to ocidOfficeDict's allValues()
set ocidOfficeNoArrayM to refMe's NSMutableArray's arrayWithArray:(ocidOfficeNoArray)
set ocidDescriptor to refMe's NSSortDescriptor's sortDescriptorWithKey:("self") ascending:(yes) selector:("localizedStandardCompare:")
set ocidDescriptorArray to refMe's NSArray's arrayWithObject:(ocidDescriptor)
set ocidSortedOfficeNoArray to ocidOfficeNoArrayM's sortedArrayUsingDescriptors:(ocidDescriptorArray)
set listOffceNo to ocidSortedOfficeNoArray as list
#キー=この場合オフィス名のリストから キーと値が逆にセットされたレコードを作成
set ocidOfficeReversedDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
set ocidOfficeNameArray to ocidOfficeDict's allKeys()
repeat with itemOfficeNameArray in ocidOfficeNameArray
  set ocidValue to (ocidOfficeDict's valueForKey:(itemOfficeNameArray))
(ocidOfficeReversedDict's setValue:(itemOfficeNameArray) forKey:(ocidValue))
end repeat
#ソートされたオフィス番号順のオフィス名リストを作成する
set listOfficeName to {} as list
repeat with itemListOfficeNo in listOffceNo
  set ocidOfficeName to (ocidOfficeReversedDict's valueForKey:(itemListOfficeNo))
  set strOfficeName to ocidOfficeName as text
  set end of listOfficeName to strOfficeName
end repeat

##ここまでの処理で作成されたのがこちら
(*

set recordOfficeReversedDict to {|017000|:"檜山地方", |070000|:"福島県", |140000|:"神奈川県", |210000|:"岐阜県", |390000|:"高知県", |011000|:"宗谷地方", |050000|:"秋田県", |120000|:"千葉県", |370000|:"香川県", |440000|:"大分県", |472000|:"大東島", |014100|:"釧路地方", |460040|:"奄美", |030000|:"岩手県", |016000|:"石狩地方", |100000|:"群馬県", |280000|:"兵庫県", |350000|:"山口県", |420000|:"長崎県", |190000|:"山梨県", |260000|:"京都府", |471000|:"沖縄", |330000|:"岡山県", |400000|:"福岡県", |015000|:"日高地方", |170000|:"石川県", |310000|:"鳥取県", |240000|:"三重県", |220000|:"静岡県", |080000|:"茨城県", |150000|:"新潟県", |130000|:"東京都", |200000|:"長野県", |060000|:"山形県", |380000|:"愛媛県", |450000|:"宮崎県", |460100|:"鹿児島県", |110000|:"埼玉県", |040000|:"宮城県", |360000|:"徳島県", |430000|:"熊本県", |290000|:"奈良県", |013000|:"網走地方", |020000|:"青森県", |340000|:"広島県", |410000|:"佐賀県", |474000|:"八重山", |270000|:"大阪府", |320000|:"島根県", |180000|:"福井県", |250000|:"滋賀県", |012000|:"留萌地方", |300000|:"和歌山県", |090000|:"栃木県", |160000|:"富山県", |473000|:"宮古島", |230000|:"愛知県"} as record

set listOfficeName to {"宗谷地方", "留萌地方", "網走地方", "釧路地方", "日高地方", "石狩地方", "檜山地方", "青森県", "岩手県", "宮城県", "秋田県", "山形県", "福島県", "茨城県", "栃木県", "群馬県", "埼玉県", "千葉県", "東京都", "神奈川県", "新潟県", "富山県", "石川県", "福井県", "山梨県", "長野県", "岐阜県", "静岡県", "愛知県", "三重県", "滋賀県", "京都府", "大阪府", "兵庫県", "奈良県", "和歌山県", "鳥取県", "島根県", "岡山県", "広島県", "山口県", "徳島県", "香川県", "愛媛県", "高知県", "福岡県", "佐賀県", "長崎県", "熊本県", "大分県", "宮崎県", "奄美", "鹿児島県", "沖縄", "大東島", "宮古島", "八重山"} as list

set listOffceNo to {"011000", "012000", "013000", "014100", "015000", "016000", "017000", "020000", "030000", "040000", "050000", "060000", "070000", "080000", "090000", "100000", "110000", "120000", "130000", "140000", "150000", "160000", "170000", "180000", "190000", "200000", "210000", "220000", "230000", "240000", "250000", "260000", "270000", "280000", "290000", "300000", "310000", "320000", "330000", "340000", "350000", "360000", "370000", "380000", "390000", "400000", "410000", "420000", "430000", "440000", "450000", "460040", "460100", "471000", "472000", "473000", "474000"} as list
*)

|

[setDictionary]レコードをDictionaryにしてキーallKeysをリストに(キー名称日本語)


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

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
use AppleScript version "2.6"
use framework "Foundation"
use framework "AppKit"
use scripting additions

property refMe : a reference to current application

set appFileManager to refMe's NSFileManager's defaultManager()
set appNSWorkspace to refMe's NSWorkspace's sharedWorkspace()

###アイコンファイル名のレコード
set recordIcon to {|アクア|:"aqua.icns", |ブルー|:"blue.icns", |ダークブルー|:"darkblue.icns", |デフォルト|:"generic.icns", |グレー|:"gray.icns", |グリーン|:"green.icns", |オレンジ|:"orange.icns", |ピンク|:"pink.icns", |レッド|:"red.icns", |グラデーション|:"syft.icns", |バイオレット|:"violet.icns", |ホワイト|:"white.icns", |イエロー|:"yellow.icns"} as record
##可変レコード
set ocidIconDict to refMe's NSMutableDictionary's alloc()'s initWithCapacity:0
##レコードセット
ocidIconDict's setDictionary:(recordIcon)
##キーリスト
set ocidAllKeys to ocidIconDict's allKeys()
##ダイアログ用にリストに
set listAllKeys to ocidAllKeys as list
#####ダイアログを前面に
tell current application
  set strName to name as text
end tell
####スクリプトメニューから実行したら
if strName is "osascript" then
  tell application "Finder" to activate
else
  tell current application to activate
end if
###ダイアログ
try
  set listResponse to (choose from list listAllKeys with title "選んでください" with prompt "アイコンを選んでください" default items (item 8 of listAllKeys) OK button name "OK" cancel button name "キャンセル" without multiple selections allowed and empty selection allowed)
on error
  log "エラーしました"
return "エラーしました"
end try
if listResponse is false then
return "キャンセルしました"
end if
set strResponse to (item 1 of listResponse) as text
###アイコンのファイル名
set ocidIconFileName to (ocidIconDict's valueForKey:(strResponse))
return ocidIconFileName as text



|

[record]新規の空のレコード

普通のテキストキーの場合

set recordBlank to {} as record

set strTmpKey to "tmpKey" as text
set strTemValue to "日本語のVALUE" as text

set recordAddTemp to recordBlank & (run script "return {" & strTmpKey & ":\"" & strTemValue & "\"}") as record

log recordAddTemp
--> {tmpKey:"日本語のVALUE"}
(*tmpKey:日本語のVALUE*)

数値がキーの場合
set recordBlank to {} as record

set numTmpKey to 999999 as integer
set strTemValue to "日本語のVALUE" as text

set recordAddTemp to recordBlank & (run script "return {|" & numTmpKey & "|:\"" & strTemValue & "\"}") as record

log recordAddTemp
--> {|999999|:"日本語のVALUE"}
(*999999:日本語のVALUE*)




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

set keyRecord to "keyName1"

set valueRecord to "車寅次郎"


set recordNew to (run script "return {" & keyRecord & ":\"" & valueRecord & "\"}") as record


log recordNew

--> (*keyItem:車寅次郎*)

log class of recordNew

--> (*record*)


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

set keyRecord to "keyName2"

set valueRecord to "車さくら"


set recordAddNew to (run script "return {" & keyRecord & ":\"" & valueRecord & "\"}") as record


set recordNew to recordNew & recordAddNew as record

log recordNew

-->(*keyItem:車寅次郎, keyName:車さくら*)

log class of recordNew

--> (*record*)


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

set keyRecord to "keyName3"

set valueRecord to "車竜造"


set recordAddNew to (run script "return {" & keyRecord & ":\"" & valueRecord & "\"}") as record


set recordNew to recordNew & recordAddNew as record

log recordNew

-->(*keyName1:車寅次郎, keyName2:車さくら, keyName3:車竜造*)

log class of recordNew

--> (*record*)



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

set keyRecord to "keyName4"

set valueRecord to "車つね"


set recordAddNew to (run script "return {" & keyRecord & ":\"" & valueRecord & "\"}") as record


set recordNew to recordNew & recordAddNew as record

log recordNew

-->(*keyName1:車寅次郎, keyName2:車さくら, keyName3:車竜造, keyName4:車つね*)

log class of recordNew

--> (*record*)


log (count of recordNew)

-->(*4*)


log contents of recordNew

--> (*keyName1:車寅次郎, keyName2:車さくら, keyName3:車竜造, keyName4:車つね*)


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


log keyName4 of recordNew

--> (*車つね*)

log keyName1 of recordNew

-->(*車寅次郎*)

|

[record]レコードの作り方色々

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


set recordTMP to {} as record

set strAddItem to ("{|AAAAA|:\"BBBB\"}") as text

set recordTMP to recordTMP & (run script "return " & strAddItem & "")

set strAddItem to ("{|CCCCC|:\"DDDDD\"}") as text
set recordTMP to recordTMP & (run script "return " & strAddItem & "")

log recordTMP
-->(*AAAAA:BBBB, CCCCC:DDDDD*)
log class of recordTMP
-->(*record*)

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

local localKey

set {localKey:strValue} to {localKey:"BBBB"} as record

set recordTEMP to {localKey:strValue} as record
-->(*localKey:BBBB*)

set localKey of recordTEMP to "CCCC"
-->(*localKey:CCCC*)


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


set listTemp to {"AAA", "BBB"}
listTemp
--> {"AAA", "BBB"}
log class of listTemp (*list*)

set listDist to {|CCCC|:listTemp}
listDist
--> {|CCCC|:{"AAA", "BBB"}}
log class of listDist (*record*)

set end of listDist's |CCCC| to "DDDD"
listDist
--> {|CCCC|:{"AAA", "BBB","DDDD"}}
log class of listDist (*record*)

listTemp
-->{"AAA", "BBB","DDDD"}
log class of listTemp (*list*)



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


set recordTMP to {} as record

set strKey to "AAAAA" as text

set strValue to "BBBB" as text


set strAddItem to (run script "return {" & strKey & ":\"" & strValue & "\"}") as record


set recordTMP to recordTMP & strAddItem as record
-->{AAAAA:"BBBB"}


|

[Sort]レコードのソート(値順)

#!/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 objNSDictionary : a reference to objMe's NSDictionary
property objNSMutableDictionary : a reference to objMe's NSMutableDictionary

set recordTMP to {} as record
########################
set strKey to "AAAA" as text

set strValue to "BBBB" as text

set strAddItem to (run script "return {" & strKey & ":\"" & strValue & "\"}") as record

set recordTMP to recordTMP & strAddItem as record
########################
set strKey to "CCCC" as text

set strValue to "DDDD" as text
set strAddItem to (run script "return {" & strKey & ":\"" & strValue & "\"}") as record

set recordTMP to recordTMP & strAddItem as record
########################
set strKey to "EEEE" as text

set strValue to "FFFF" as text
set strAddItem to (run script "return {" & strKey & ":\"" & strValue & "\"}") as record

set recordTMP to recordTMP & strAddItem as record

########################
set strKey to "GGGG" as text

set strValue to "HHHH" as text
set strAddItem to (run script "return {" & strKey & ":\"" & strValue & "\"}") as record

set recordTMP to recordTMP & strAddItem as record

########################
###出来上がったレコード
log recordTMP
-->(*AAAA:BBBB, CCCC:DDDD, EEEE:FFFF, GGGG:HHHH*)
###レコードの数
set numCntRecord to count of recordTMP
log numCntRecord
-->(*4*)
###可変レコードに
set ocidDictionary to objNSMutableDictionary's dictionaryWithDictionary:recordTMP
###キーの値をリストに
set ocidAllValues to ocidDictionary's allValues()
###キーの値が未ソートの処理前
log ocidAllValues as list
-->(*DDDD, BBBB, HHHH, FFFF*)
###ソートの方法の定義
set theDescriptor to objMe's NSSortDescriptor's sortDescriptorWithKey:"self" ascending:true selector:"localizedStandardCompare:"
###並び替え
set ocidSortedAllValues to (ocidAllValues's sortedArrayUsingDescriptors:{theDescriptor})
log ocidSortedAllValues as list
-->(*BBBB, DDDD, FFFF, HHHH*)
###並び変わった値を順番に
repeat with ocidValues in ocidSortedAllValues
log ocidValues as text
-->(*BBBB*)
-->(*DDDD*)
-->(*FFFF*)
-->(*HHHH*)
end repeat

|

より以前の記事一覧

その他のカテゴリー

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