Keynoteの現在のスライド上のshapeオブジェクトのうち、一番左のものに他のものの高さをそろえるAppleScriptです。
AppleScript名:現在のスライド上のshapeオブジェクトのうち一番左のものに他のものの高さをそろえる |
— Created 2018-05-25 by Takaaki Naganoya — 2018 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use bPlus : script "BridgePlus" –https://www.macosxautomation.com/applescript/apps/BridgePlus.html tell application "Keynote" tell front document tell (current slide) — すべてのshapeオブジェクトの座標{x,y}を返す set pList to position of every shape — shapeオブジェクトの全座標を昇順ソートして最もX座標値が小さいものを返す set mostLeftPos to first item of sort2DList(pList) of me — 一番X座標値が小さい(=左にある)オブジェクトを特定 set mostLeftObj to first item of (every shape whose position is equal to mostLeftPos) set mostLeftProp to properties of mostLeftObj –> (*class:shape, opacity:100, parent:slide 5 of document id 253165F1-0596-4E72-B9E3-2AB6D6084125, reflection showing:false, background fill type:color fill, position:32, 160, object text:, width:56, rotation:0, reflection value:0, height:467, locked:false*) set mostLeftHeight to height of mostLeftProp set mostLeftWidth to width of mostLeftProp — 「一番左」以外のshapeオブジェクトへの参照を取得して一気にオブジェクトのHeightをそろえる set otherShape to a reference to (every shape whose position is not equal to mostLeftPos) set height of otherShape to mostLeftHeight end tell end tell end tell on sort2DList(aList) load framework set sortIndexes to {0} –Key Item id: begin from 0 set sortOrders to {true} –ascending = true set sortTypes to {"compare:"} set resList to (current application’s SMSForder’s subarraysIn:(aList) sortedByIndexes:sortIndexes ascending:sortOrders sortTypes:sortTypes |error|:(missing value)) as list return resList end sort2DList |
More from my site
(Visited 36 times, 1 visits today)