« [AppleScript]ゼロパディング処理 | トップページ | [sips]画像のパディング padToHeightWidth padColor »

[sips]画像の解像度 dpiWidth dpiHeight

例文
/usr/bin/sips --setProperty dpiHeight 72 "/System/Library/Desktop Pictures/Monterey Graphic.heic" --setProperty format png -o ~/Desktop/dpiHeight.jpg


/usr/bin/sips --setProperty dpiWidth 72 "/System/Library/Desktop Pictures/Monterey Graphic.heic" --setProperty format png -o ~/Desktop/dpiWidth.jpg

ダウンロード - sips2dpiwidth.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 scripting additions

set aliasLocationPath to (path to desktop pictures folder from system domain)
set aliasImageFilePath to (choose file of type {"public.image", "public.tiff", "public.png", "public.jpeg", "com.adobe.photoshop-image", "public.heic"} with prompt "ファイルを選んで" default location aliasLocationPath without invisibles, showing package contents and multiple selections allowed)

set theImageFilePath to POSIX path of aliasImageFilePath as text


set numDip to 72 as number


####通常2行での応答時
set theCommandText to ("/usr/bin/sips --setProperty dpiHeight " & numDip & " \"" & theImageFilePath & "\" --setProperty format png -o ~/Desktop/dpiHeight.png") as text
log "theCommandText:" & theCommandText
do shell script theCommandText

####
set theCommandText to ("/usr/bin/sips --setProperty dpiWidth " & numDip & " \"" & theImageFilePath & "\" --setProperty format png -o ~/Desktop/dpiWidth.png") as text
log "theCommandText:" & theCommandText
do shell script theCommandText



return

|

« [AppleScript]ゼロパディング処理 | トップページ | [sips]画像のパディング padToHeightWidth padColor »

sips」カテゴリの記事