Menu

Skip to content
AppleScriptの穴
  • Home
  • Products
  • Books
  • Docs
  • Events
  • Forum
  • About This Blog
  • License
  • 仕事依頼

AppleScriptの穴

Useful & Practical AppleScript archive. Click '★Click Here to Open This Script' Link to download each AppleScript

タグ: 10.13savvy

配列に指定要素が含まれているかチェック

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:配列に指定要素が含まれているかチェック
— Created 2015-09-02 by Takaaki Naganoya
— 2015 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set anArray to current application’s NSArray’s arrayWithObjects_(1, 2, 3)
–>  (NSArray) {​​​​​1, ​​​​​2, ​​​​​3​​​}

–指定要素が含まれているか
set bRes to (anArray’s containsObject:1) as boolean
–>  true
set cRes to (anArray’s containsObject:100) as boolean
–>  false

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

1D List中の存在確認(ASOC)

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:1D List中の存在確認(ASOC)
— Created 2017-10-03 17:56:08 +0900 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set kinsokuCharList to {"︒", "︑", "﹁", "﹂", "﹃", "﹄", "︻", "︼", "﹇", "﹈", "︷", "︸", "︵", "︶", "︱", "⌇", "ァ", "ィ", "ゥ", "ェ", "ォ", "ョ", "ぁ", "ぃ", "ぅ", "ぇ", "ぉ", "ょ"}
set aRes to offsetInList("ぁ", kinsokuCharList) of me
–> 22
set aRes to offsetInList("あ", kinsokuCharList) of me

on offsetInList(aChar, aList)
  set anArray to current application’s NSArray’s arrayWithArray:aList
  
set aInd to (anArray’s indexOfObject:aChar)
  
if aInd = current application’s NSNotFound or (aInd as number) > 9.99999999E+8 then
    return false
  else
    return aInd as integer
  end if
end offsetInList

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

1D List中の存在確認(n vs n)

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:1D List中の存在確認(n vs n)
— Created 2017-10-29 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set list1 to {5, 1, 2, 3, 1, 6, 2, 7, 8, 2, 6, 5, 4}
set list2 to {8, 9, 10}
set list3 to {6, 7, 8}

set result1 to my doesList:list1 containList:list2
–> false
set result2 to my doesList:list1 containList:list3
–> true

set result1 to doesListContain for list1 by list2
–>  false
set result1 to doesListContain for list1 by list3
–>  true

set result1 to doesListContainAB(list1, list2) of me
–>  false
set result2 to doesListContainAB(list1, list3) of me
–>  true

–Objective-Cライクなパラメータ記述
on doesList:list1 containList:list2
  set set1 to current application’s NSSet’s setWithArray:list1
  
set set2 to current application’s NSSet’s setWithArray:list2
  
return ((set2’s isSubsetOfSet:set1) as integer = 1)
end doesList:containList:

–無意味区による装飾
on doesListContain for list1 by list2
  set result1 to my doesList:list1 containList:list2
  
return result1
end doesListContain

–Pure AS風のパラメータ記述
on doesListContainAB(list1, list2)
  set result1 to my doesList:list1 containList:list2
  
return result1
end doesListContainAB

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

2つの1D Listの共通項を返す v2

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:2つの1D Listの共通項を返す v2
— Created 2014-11-18 by Takaaki Naganoya
— 2014 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

–aList内に重複項目、bList内に重複項目が存在していた場合に、それが検出される可能性もある
set aList to {1, 2, 3, 4, 5}
set bList to {0, 1, 2, 4, 5, 6}

set aRes to getSameItemsInLists(aList, bList) of me
–> {2, 5, 1, 4}

on getSameItemsInLists(aList as list, bList as list)
  
  
–ASオブジェクトをCocoaオブジェクトに変換
  
set aArray to current application’s NSArray’s arrayWithArray:aList
  
set bArray to current application’s NSArray’s arrayWithArray:bList
  
  
— まとめる
  
set allSet to current application’s NSMutableSet’s setWithArray:aArray
  
allSet’s addObjectsFromArray:bArray
  
  
–重複する要素のみ抜き出す
  
set duplicateSet to current application’s NSMutableSet’s setWithArray:aArray
  
duplicateSet’s intersectSet:(current application’s NSSet’s setWithArray:bArray)
  
  
–重複部分だけを返す
  
set resArray to duplicateSet’s allObjects()
  
  
set resList to resArray as list
  
  
return resList
  
end getSameItemsInLists

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

1D Listから重複項目のみ抽出 v2

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:1D Listから重複項目のみ抽出 v2
— Created 2017-11-07 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
–http://piyocast.com/as/archives/4955

property NSCountedSet : a reference to current application’s NSCountedSet

set aList to {1, 2, 3, 4, 1, 2, 3, 4, 5, 1, 2, 3, 1, 2, 3, 8, 10, -2}
set aRes to returnDuplicatesOnly(aList) of me
–>  {​​​​​1, ​​​​​2, ​​​​​3, ​​​​​4​​​}

on returnDuplicatesOnly(aList as list)
  set aSet to NSCountedSet’s alloc()’s initWithArray:aList
  
set bList to (aSet’s allObjects()) as list
  
  
set dupList to {}
  
repeat with i in bList
    set aRes to (aSet’s countForObject:i)
    
if aRes > 1 then
      set the end of dupList to (contents of i)
    end if
  end repeat
  
  
return dupList
end returnDuplicatesOnly

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

2つの1D Listから重複項目のみ抽出。個別の重複項目のチェックつき

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:2つの1D Listから重複項目のみ抽出。個別の重複項目のチェックつき
— Created 2017-12-17 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

property NSCountedSet : a reference to current application’s NSCountedSet

set aList to {1, 2, 3, 4, 5}
set bList to {0, 1, 2, 4, 5, 6}

–それぞれのListに重複項目が存在するかをチェック
set aRes1 to returnDuplicatesOnly(aList) of me
set bRes1 to returnDuplicatesOnly(bList) of me
if {aRes1, bRes1} is not equal to {{}, {}} then return false

–aListとbListを連結したListで重複が存在するかをチェック
set aArray to current application’s NSArray’s arrayWithArray:aList
set bArray to current application’s NSArray’s arrayWithArray:bList
set cArray to aArray’s arrayByAddingObjectsFromArray:bArray

set cRes to returnDuplicatesOnly(cArray) of me
–>  {​​​​​5, ​​​​​1, ​​​​​2, ​​​​​4​​​}

on returnDuplicatesOnly(aList as list)
  set aSet to NSCountedSet’s alloc()’s initWithArray:aList
  
set bList to (aSet’s allObjects()) as list
  
  
set dupList to {}
  
repeat with i in bList
    set aRes to (aSet’s countForObject:i)
    
if aRes > 1 then
      set the end of dupList to (contents of i)
    end if
  end repeat
  
  
return dupList
end returnDuplicatesOnly

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

ASOCでSystemのアラートサウンド名称を取得して同時に鳴らす v2.2a(Array内のオブジェクトに一括指令)

Posted on 2月 7, 2018 by Takaaki Naganoya

使用中のコンピュータにインストールされているアラートサウンド(警告音)の名称を取得して、音を同時に鳴らすAppleScriptです。

NSArrayに入れたオブジェクトに対して一括でメッセージを送るという処理の実験でもあります。

AppleScript名:ASOCでSystemのアラートサウンド名称を取得して同時に鳴らす v2.2a(Array内のオブジェクトに一括指令)
— Created 2015-11-06 by Takaaki Naganoya
— Modified 2015-11-07 by Shane Stanley–Recovery the compatibility for OS X 10.10.x
— Modified 2015-11-07 by Takaaki Naganoya–NSArrayからvalueForKeyで加工しつつ一気にArrayで値を返す内容を検証
— Modified 2015-11-07 by Shane Stanley–Cooler processing
— 2015 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"

set nList to getSystemAlertSoundNames() of me
–>  {​​​​​"Basso", ​​​​​"Blow", ​​​​​"Bottle", ​​​​​"Frog", ​​​​​"Funk", ​​​​​"Glass", ​​​​​"Hero", ​​​​​"Morse", ​​​​​"Ping", ​​​​​"Pop", ​​​​​"Purr", ​​​​​"Sosumi", ​​​​​"Submarine", ​​​​​"Tink"​​​}

set aArray to current application’s NSMutableArray’s new()

repeat with i in nList
  (aArray’s addObject:(current application’s NSSound’s soundNamed:i))
end repeat

aArray’s makeObjectsPerformSelector:"play" withObject:0 –同時に鳴らす

–Get System Alert FileName List
on getSystemAlertSoundNames()
  set aExt to "aiff" — no dot
  
set aFol to "/System/Library/Sounds"
  
set fList to getFileNameListFromPOSIXpath(aFol, aExt) of me
  
return fList
end getSystemAlertSoundNames

–Get File Name List from POSIX path and file Extensions
on getFileNameListFromPOSIXpath(aFol, aExt)
  set aFM to current application’s NSFileManager’s defaultManager()
  
set aURL to current application’s |NSURL|’s fileURLWithPath:aFol
  
set urlArray to aFM’s contentsOfDirectoryAtURL:aURL includingPropertiesForKeys:{} options:(current application’s NSDirectoryEnumerationSkipsHiddenFiles) |error|:(missing value)
  
set thePred to current application’s NSPredicate’s predicateWithFormat:"pathExtension == [c]%@" argumentArray:{aExt}
  
set anArray to urlArray’s filteredArrayUsingPredicate:thePred
  
set bArray to (anArray’s valueForKeyPath:"lastPathComponent.stringByDeletingPathExtension") –Cool !!
  
return bArray as list
end getFileNameListFromPOSIXpath

★Click Here to Open This Script 

Posted in list System | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

1Dリスト内の数値をすべて文字列化

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:1Dリスト内の数値をすべて文字列化
— Created 2017-01-30 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set anArray to current application’s NSArray’s arrayWithArray:{1, 2, 3}
set aVal to anArray’s valueForKey:"stringValue"
–>  (NSArray) {"1", "2", "3"}

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

1Dリスト内のテキストの文字列長を取得

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:1Dリスト内のテキストの文字列長を取得
— Created 2017-01-30 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set anArray to current application’s NSArray’s arrayWithArray:{"aaaa1", "sss2", "aaaa3"}
set aVal to anArray’s valueForKeyPath:"length"
–>  (NSArray) {​​​​​5, ​​​​​4, ​​​​​5​​​}

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

1Dリスト内の数値をすべて浮動小数点表現に

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:1Dリスト内の数値をすべて浮動小数点表現に
— Created 2017-01-30 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set anArray to current application’s NSArray’s arrayWithArray:{1, 2, 3}
set aVal to anArray’s valueForKey:"doubleValue"
–>  (NSArray) {​​​​​1.0, ​​​​​2.0, ​​​​​3.0​​​}

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

1Dリスト内の数値をすべて整数に

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:1Dリスト内の数値をすべて整数に
— Created 2017-01-30 16:01:49 +0900 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set anArray to current application’s NSArray’s arrayWithArray:{1.0, 0.0, 1.0, -1.0}
set aVal to anArray’s valueForKey:"intValue"
–>  (NSArray) {​​​​​1, ​​​​​0, ​​​​​1, ​​​​​-1​​​}

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

2Dリスト内の要素をすべて加算

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:2Dリスト内の要素をすべて加算
— Created 2017-10-01 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set aList to {{1, 2, 3, 4, 5, 6, 4}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 16, 0, 0}}
set aRes to getTotalValueFrom2DArray(aList) of me
–>  77 –total value is 0

on getTotalValueFrom2DArray(aList)
  set anArray to current application’s NSArray’s arrayWithArray:aList
  
set eRes to (anArray’s valueForKeyPath:"@unionOfArrays.self")’s valueForKeyPath:"@sum.self"
  
return eRes as integer
end getTotalValueFrom2DArray

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

2Dリスト内の要素の平均値を求める

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:2Dリスト内の要素の平均値を求める
— Created 2017-10-01 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set aList to {{1, 2, 3, 4, 5, 6, 4}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 16, 0, 0}} –7,6, 8 items
set aRes to getAverageValueFrom2DArray(aList) of me
–>  4 –average value is 0

on getAverageValueFrom2DArray(aList)
  set anArray to current application’s NSArray’s arrayWithArray:aList
  
set eRes to (anArray’s valueForKeyPath:"@unionOfArrays.self")’s valueForKeyPath:"@avg.self"
  
return eRes as integer
end getAverageValueFrom2DArray

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

2Dリスト内の要素のすべての要素をカウント

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:2Dリスト内の要素のすべての要素をカウント
— Created 2017-10-01 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

–set aList to {{1, 2, 3, 4, 5, 6, 4}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 16, 0, 0}}
set aList to {{{1, 2}, {3, 4}, {5, 6, 4}}, {{1, 2}, {3, 4, 5, 6}, {{1, 2}, {3, 4, 5}, {16, 0, 0}}}}
set aRes to countEveryItemOf2DArray(aList) of me
–>  21

on countEveryItemOf2DArray(aList)
  set bList to FlattenList(aList) of me
  
return (length of bList)
end countEveryItemOf2DArray

–By Paul Berkowitz
–2009年1月27日 2:24:08:JST
–Re: Flattening Nested Lists
on FlattenList(aList)
  set oldDelims to AppleScript’s text item delimiters
  
set AppleScript’s text item delimiters to {"????"}
  
set aString to aList as text
  
set aList to text items of aString
  
set AppleScript’s text item delimiters to oldDelims
  
return aList
end FlattenList

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

2Dリスト内の要素のうち最大値を求める

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:2Dリスト内の要素のうち最大値を求める
— Created 2017-10-01 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set aList to {{1, 2, 3, 4, 5, 6, 4}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 16, 0, 0}} –7,6, 8 items
set aRes to getMaxValueFrom2DArray(aList) of me
–>  16 –max value is 16

on getMaxValueFrom2DArray(aList)
  set anArray to current application’s NSArray’s arrayWithArray:aList
  
set eRes to (anArray’s valueForKeyPath:"@unionOfArrays.self")’s valueForKeyPath:"@max.self"
  
return eRes as integer
end getMaxValueFrom2DArray

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

2Dリスト内の要素のうち最小値を求める

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:2Dリスト内の要素のうち最小値を求める
— Created 2017-10-01 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set aList to {{1, 2, 3, 4, 5, 6, 4}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 16, 0, 0}} –7,6, 8 items
set aRes to getMinValueFrom2DArray(aList) of me
–>  0 –min value is 0

on getMinValueFrom2DArray(aList)
  set anArray to current application’s NSArray’s arrayWithArray:aList
  
set eRes to (anArray’s valueForKeyPath:"@unionOfArrays.self")’s valueForKeyPath:"@min.self"
  
return eRes as integer
end getMinValueFrom2DArray

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

ASOCでテキストとリストの変換

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:ASOCでテキストとリストの変換
— Created 2015-10-14 by Takaaki Naganoya
— 2015 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set aList to {"あああああ", "いいいいいいいい", "ううううううううううう", "えええええええええええ", "おおおおおおおおおお"}
set aRes to my retStrFromArrayWithDelimiter(aList, return)
(*
"あああああ
いいいいいいいい
ううううううううううう
えええええええええええ
おおおおおおおおおお"
*)

set bList to my parseByDelim(aRes, return)
–>  {​​​​​"あああああ", ​​​​​"いいいいいいいい", ​​​​​"ううううううううううう", ​​​​​"えええええええええええ", ​​​​​"おおおおおおおおおお"​​​}

–リストを指定デリミタをはさんでテキスト化
on retStrFromArrayWithDelimiter(aList, aDelim)
  set anArray to current application’s NSArray’s arrayWithArray:aList
  
set aRes to anArray’s componentsJoinedByString:aDelim
  
return aRes as text
end retStrFromArrayWithDelimiter

on retArrowText(aList, aDelim) –自分のASでよく使うハンドラ名称なので、同じものを用意
  return my retStrFromArrayWithDelimiter(aList, aDelim)
end retArrowText

–テキストを指定デリミタでリスト化
on parseByDelim(aData, aDelim)
  set aText to current application’s NSString’s stringWithString:aData
  
set aList to aText’s componentsSeparatedByString:aDelim
  
return aList as list
end parseByDelim

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

1Dリストを指定個数ごとにリスト化して2D化 v3.2

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:1Dリストを指定個数ごとにリスト化して2D化 v3.2
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use bPlus : script "BridgePlus" –https://www.macosxautomation.com/applescript/apps/BridgePlus.html

script spd
  property aList : {}
end script

–テストデータ作成
set aList of spd to {}
repeat 100000 times
  set the end of aList of spd to (random number from 10000 to 9999)
end repeat

set a1Dat to current application’s NSDate’s timeIntervalSinceReferenceDate() –時間計測

set aGroupNum to 100000
set b to (current application’s SMSForder’s subarraysFrom:(aList of spd) groupedBy:aGroupNum |error|:(missing value)) as list

set b1Dat to current application’s NSDate’s timeIntervalSinceReferenceDate() –時間計測
set c1Dat to b1Dat – a1Dat
–> 0.688337981701

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

2Dリストから、指定カラムのデータを削除する v3

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:2Dリストから、指定カラムのデータを削除する v3
— Created 2017-11-25 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
–http://piyocast.com/as/archives/5000

set aList to {{1, 2, 3}, {2, 3, 4}, {3, 4, 5}}
set removeIndex to 3 –1 based index
set bList to removeColumnFrom2DArray(aList, removeIndex) of me
–>  {​​​​​{​​​​​​​1, ​​​​​​​2​​​​​}, ​​​​​{​​​​​​​2, ​​​​​​​3​​​​​}, ​​​​​{​​​​​​​3, ​​​​​​​4​​​​​}​​​}

on removeColumnFrom2DArray(aList as list, removeIndex as integer)
  set newArray to {}
  
set realIndex to removeIndex – 1 –index conversion from 1-based to 0-based
  
repeat with i in aList
    set anArray to (current application’s NSMutableArray’s arrayWithArray:i)
    (
anArray’s removeObjectAtIndex:realIndex)
    
set the end of newArray to anArray as list of string or string –as anything
  end repeat
  
return newArray
end removeColumnFrom2DArray

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

リスト中の指定アイテムを削除する(登場アイテム番号自動検索)

Posted on 2月 7, 2018 by Takaaki Naganoya
AppleScript名:リスト中の指定アイテムを削除する(登場アイテム番号自動検索)
— Created 2017-04-11 by Takaaki Naganoya
— 2017 Piyomaru Software
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"

set aTargValue to 2

set anArray to current application’s NSMutableArray’s arrayWithArray:{5, 2, 1, 3, 4}
set aInd to anArray’s indexOfObject:aTargValue

if aInd = current application’s NSNotFound or (aInd as real > 9.99999999E+8) then return {}
anArray’s removeObjectAtIndex:aInd
return anArray as list
–> {​​​​​5, ​​​​​1, ​​​​​3, ​​​​​4​​​}

★Click Here to Open This Script 

Posted in list | Tagged 10.11savvy 10.12savvy 10.13savvy | Leave a comment

Post navigation

  • Older posts
  • Newer posts

電子書籍(PDF)をオンラインストアで販売中!

Google Search

Popular posts

  • 開発機としてM2 Mac miniが来たのでガチレビュー
  • macOS 15, Sequoia
  • 指定のWordファイルをPDFに書き出す
  • Pages本執筆中に、2つの書類モード切り替えに気がついた
  • Numbersで選択範囲のセルの前後の空白を削除
  • メキシカンハットの描画
  • Pixelmator Pro v3.6.4でAppleScriptからの操作時の挙動に違和感が
  • AdobeがInDesign v19.4からPOSIX pathを採用
  • AppleScriptによる並列処理
  • Safariで「プロファイル」機能を使うとAppleScriptの処理に影響
  • Cocoa Scripting Course 続刊計画
  • macOS 14.xでScript Menuの実行速度が大幅に下がるバグ
  • AppleScript入門③AppleScriptを使った「自動化」とは?
  • Keynote/Pagesで選択中の表カラムの幅を均等割
  • macOS 15でも変化したText to Speech環境
  • デフォルトインストールされたフォント名を取得するAppleScript
  • macOS 15 リモートApple Eventsにバグ?
  • AppleScript入門① AppleScriptってなんだろう?
  • macOS 14で変更になったOSバージョン取得APIの返り値
  • Keynoteで2階層のスライドのタイトルをまとめてテキスト化

Tags

10.11savvy (1101) 10.12savvy (1242) 10.13savvy (1391) 10.14savvy (587) 10.15savvy (438) 11.0savvy (283) 12.0savvy (212) 13.0savvy (194) 14.0savvy (147) 15.0savvy (132) CotEditor (66) Finder (51) iTunes (19) Keynote (117) NSAlert (61) NSArray (51) NSBitmapImageRep (20) NSBundle (20) NSButton (34) NSColor (53) NSDictionary (28) NSFileManager (23) NSFont (21) NSImage (41) NSJSONSerialization (21) NSMutableArray (63) NSMutableDictionary (22) NSPredicate (36) NSRunningApplication (56) NSScreen (30) NSScrollView (22) NSString (119) NSURL (98) NSURLRequest (23) NSUTF8StringEncoding (30) NSView (33) NSWorkspace (20) Numbers (76) Pages (55) Safari (44) Script Editor (27) WKUserContentController (21) WKUserScript (20) WKWebView (23) WKWebViewConfiguration (22)

カテゴリー

  • 2D Bin Packing
  • 3D
  • AirDrop
  • AirPlay
  • Animation
  • AppleScript Application on Xcode
  • Beginner
  • Benchmark
  • beta
  • Bluetooth
  • Books
  • boolean
  • bounds
  • Bug
  • Calendar
  • call by reference
  • check sum
  • Clipboard
  • Cocoa-AppleScript Applet
  • Code Sign
  • Color
  • Custom Class
  • date
  • dialog
  • diff
  • drive
  • Droplet
  • exif
  • file
  • File path
  • filter
  • folder
  • Font
  • Font
  • GAME
  • geolocation
  • GUI
  • GUI Scripting
  • Hex
  • History
  • How To
  • iCloud
  • Icon
  • Image
  • Input Method
  • Internet
  • iOS App
  • JavaScript
  • JSON
  • JXA
  • Keychain
  • Keychain
  • Language
  • Library
  • list
  • Locale
  • Localize
  • Machine Learning
  • Map
  • Markdown
  • Menu
  • Metadata
  • MIDI
  • MIME
  • Natural Language Processing
  • Network
  • news
  • Noification
  • Notarization
  • Number
  • Object control
  • OCR
  • OSA
  • parallel processing
  • PDF
  • Peripheral
  • PRODUCTS
  • QR Code
  • Raw AppleEvent Code
  • Record
  • rectangle
  • recursive call
  • regexp
  • Release
  • Remote Control
  • Require Control-Command-R to run
  • REST API
  • Review
  • RTF
  • Sandbox
  • Screen Saver
  • Script Libraries
  • sdef
  • search
  • Security
  • selection
  • shell script
  • Shortcuts Workflow
  • Sort
  • Sound
  • Spellchecker
  • Spotlight
  • SVG
  • System
  • Tag
  • Telephony
  • Text
  • Text to Speech
  • timezone
  • Tools
  • Update
  • URL
  • UTI
  • Web Contents Control
  • WiFi
  • XML
  • XML-RPC
  • イベント(Event)
  • 未分類

アーカイブ

  • 2025年5月
  • 2025年4月
  • 2025年3月
  • 2025年2月
  • 2025年1月
  • 2024年12月
  • 2024年11月
  • 2024年10月
  • 2024年9月
  • 2024年8月
  • 2024年7月
  • 2024年6月
  • 2024年5月
  • 2024年4月
  • 2024年3月
  • 2024年2月
  • 2024年1月
  • 2023年12月
  • 2023年11月
  • 2023年10月
  • 2023年9月
  • 2023年8月
  • 2023年7月
  • 2023年6月
  • 2023年5月
  • 2023年4月
  • 2023年3月
  • 2023年2月
  • 2023年1月
  • 2022年12月
  • 2022年11月
  • 2022年10月
  • 2022年9月
  • 2022年8月
  • 2022年7月
  • 2022年6月
  • 2022年5月
  • 2022年4月
  • 2022年3月
  • 2022年2月
  • 2022年1月
  • 2021年12月
  • 2021年11月
  • 2021年10月
  • 2021年9月
  • 2021年8月
  • 2021年7月
  • 2021年6月
  • 2021年5月
  • 2021年4月
  • 2021年3月
  • 2021年2月
  • 2021年1月
  • 2020年12月
  • 2020年11月
  • 2020年10月
  • 2020年9月
  • 2020年8月
  • 2020年7月
  • 2020年6月
  • 2020年5月
  • 2020年4月
  • 2020年3月
  • 2020年2月
  • 2020年1月
  • 2019年12月
  • 2019年11月
  • 2019年10月
  • 2019年9月
  • 2019年8月
  • 2019年7月
  • 2019年6月
  • 2019年5月
  • 2019年4月
  • 2019年3月
  • 2019年2月
  • 2019年1月
  • 2018年12月
  • 2018年11月
  • 2018年10月
  • 2018年9月
  • 2018年8月
  • 2018年7月
  • 2018年6月
  • 2018年5月
  • 2018年4月
  • 2018年3月
  • 2018年2月

https://piyomarusoft.booth.pm/items/301502

メタ情報

  • ログイン
  • 投稿フィード
  • コメントフィード
  • WordPress.org

Forum Posts

  • 人気のトピック
  • 返信がないトピック

メタ情報

  • ログイン
  • 投稿フィード
  • コメントフィード
  • WordPress.org
Proudly powered by WordPress
Theme: Flint by Star Verte LLC