« Pantone Color of the Year 2018(PANTONE 18-3838 ULTRA VIOLET TCX) | トップページ | Jack Reacher | アウトロー »

Install PANTONE Color of the Year 2011-2018

AiのCS6〜CC2018までのユーザー・サポートディレクトリに
Pantoneのカラースウォッチをインストールします。

インストール先は
Website_image00291209_104746


Aiのカラーパレットから利用出来ます
Website_image00291209_104847


(*
Install_ PANTONE_Color_of_the_Year_2011_2018

Illustrator

20171210 初回作成
20171209 2018 Pantone Color of the Year 2018PANTONE 18-3838 ULTRA VIOLET TCX)に対応
*)



---ユーザー名を取得する
set objSysInfo to system info
set theUserName to (short user name of objSysInfo) as text

---日付けと時間からテンポラリー用のフォルダ名を作成
set theNowTime to (my doDateAndTIme(current date)) as text

---テンポラリー用フォルダのパスを定義
set theDownloadDir to ("/tmp/" & theNowTime & "") as text

-----テンポラリーフォルダを作成
try
set theCommand to ("mkdir -pv \"" & theDownloadDir & "\"") as text
do shell script theCommand
set theTmpPath to theDownloadDir as text
delay 1
on error
return "テンポラリフォルダ作成でエラーが発生しました"
end try

-----ファイルをダウンロード
try
set theCommand to ("curl -L -o '" & theTmpPath & "/PANTONE.zip' 'https://force4u.cocolog-nifty.com/file/PANTONE.zip'") as text
do shell script theCommand
delay 1
on error
return "ファイルダウンロードでエラーが発生しました"
end try

-----ファイルを解凍
try
---リソースフォークがるので(オリジナルに)dittoでの解凍を試す
set theCommand to ("ditto -xk --sequesterRsrc --rsrc '" & theTmpPath & "/PANTONE.zip' '" & theTmpPath & "'") as text
do shell script theCommand
delay 1
on error
---エラーしたら普通にunzipで解凍
try
set theCommand to ("unzip '" & theTmpPath & "/PANTONE.zip' -d '" & theTmpPath & "'") as text
do shell script theCommand
delay 1
on error
return "ファイルの解凍でエラーが発生しました"
end try
end try
-----インストール先のフォルダを定義
set theCS6AppSupDir to ("'/Users/" & theUserName & "/Library/Application Support/Adobe/Adobe Illustrator CS6/ja_JP/スウォッチ/'") as text
set the17AppSupDir to ("'/Users/" & theUserName & "/Library/Application Support/Adobe/Adobe Illustrator 17/ja_JP/スウォッチ/'") as text
set the18AppSupDir to ("'/Users/" & theUserName & "/Library/Application Support/Adobe/Adobe Illustrator 18/ja_JP/スウォッチ/'") as text
set the19AppSupDir to ("'/Users/" & theUserName & "/Library/Application Support/Adobe/Adobe Illustrator 19/ja_JP/スウォッチ/'") as text
set the20AppSupDir to ("'/Users/" & theUserName & "/Library/Application Support/Adobe/Adobe Illustrator 20/ja_JP/スウォッチ/'") as text
set the21AppSupDir to ("'/Users/" & theUserName & "/Library/Application Support/Adobe/Adobe Illustrator 21/ja_JP/スウォッチ/'") as text
set the22AppSupDir to ("'/Users/" & theUserName & "/Library/Application Support/Adobe/Adobe Illustrator 22/ja_JP/スウォッチ/'") as text
set the23AppSupDir to ("'/Users/" & theUserName & "/Library/Application Support/Adobe/Adobe Illustrator 23/ja_JP/スウォッチ/'") as text

-----インストール先のフォルダを確保
try
set theCommand to ("mkdir -p " & theCS6AppSupDir & "") as text
do shell script theCommand
set theCommand to ("mkdir -p " & the17AppSupDir & "") as text
do shell script theCommand
set theCommand to ("mkdir -p " & the18AppSupDir & "") as text
do shell script theCommand
set theCommand to ("mkdir -p " & the19AppSupDir & "") as text
do shell script theCommand
set theCommand to ("mkdir -p " & the20AppSupDir & "") as text
do shell script theCommand
set theCommand to ("mkdir -p " & the21AppSupDir & "") as text
do shell script theCommand
set theCommand to ("mkdir -p " & the22AppSupDir & "") as text
do shell script theCommand
set theCommand to ("mkdir -p " & the23AppSupDir & "") as text
do shell script theCommand

on error
return "コピー先ディレクトリ作成でエラーが発生しました"
end try
-----ファイルを移動(おきかえ)
try
set theCommand to ("cp -R " & theTmpPath & "/PANTONE/* " & theCS6AppSupDir & "") as text
do shell script theCommand
set theCommand to ("cp -R " & theTmpPath & "/PANTONE/* " & the17AppSupDir & "") as text
do shell script theCommand
set theCommand to ("cp -R " & theTmpPath & "/PANTONE/* " & the18AppSupDir & "") as text
do shell script theCommand
set theCommand to ("cp -R " & theTmpPath & "/PANTONE/* " & the19AppSupDir & "") as text
do shell script theCommand
set theCommand to ("cp -R " & theTmpPath & "/PANTONE/* " & the20AppSupDir & "") as text
do shell script theCommand
set theCommand to ("cp -R " & theTmpPath & "/PANTONE/* " & the21AppSupDir & "") as text
do shell script theCommand
set theCommand to ("cp -R " & theTmpPath & "/PANTONE/* " & the22AppSupDir & "") as text
do shell script theCommand
set theCommand to ("cp -R " & theTmpPath & "/PANTONE/* " & the23AppSupDir & "") as text
do shell script theCommand
on error
return "ファイルのコピーでエラーが発生しました"
end try




return "インストールが終了しました"


--------------------------------------------------#ここからサブルーチン
to doDateAndTIme(theDate)
set y to (year of theDate)
set m to my monthNumStr(month of theDate)
set d to day of theDate
set hms to time of theDate
set hh to h of sec2hms(hms)
set mm to m of sec2hms(hms)
set ss to s of sec2hms(hms)
return (y as text) & my zero1(m) & my zero1(d) & "_" & zero1(hh) & zero1(mm) & zero1(ss)
return (y as text) & my zero1(m) & my zero1(d)
end doDateAndTIme

------------------------------
to monthNumStr(theMonth)
set monList to {January, February, March, April, May, June, July, August, September, October, November, December}
repeat with i from 1 to 12
if item i of monList is theMonth then exit repeat
end repeat
return i
end monthNumStr
------------------------------
to sec2hms(sec)
set ret to {h:0, m:0, s:0}
set h of ret to sec div hours
set m of ret to (sec - (h of ret) * hours) div minutes
set s of ret to sec mod minutes
return ret
end sec2hms
------------------------------
to zero1(n)
if n < 10 then
return "0" & n
else
return n as text
end if
end zero1



「Install_PANTONE_Color_of_the_Year_2011_2018.scpt.zip」をダウンロード

「Install_PANTONE_Color_of_the_Year_2011_2018.rtf」をダウンロード

|

« Pantone Color of the Year 2018(PANTONE 18-3838 ULTRA VIOLET TCX) | トップページ | Jack Reacher | アウトロー »

Colors」カテゴリの記事