我目前處於創建工作流程的最後階段,該工作流程涉及使用Excel中的數據插入圖像的非常繁瑣且每週繪製的過程。Applescript - 將圖像插入Excel時保留圖像尺寸
我已經設法制定了Automator和Applescript的組合來實現一個工作流程,該工作流程可以在excel中找到圖像,但在我當前的applescript中,它們以設定的大小進入,100 x 100
這裏是問題:
我需要所有的圖像在100px的高度進來,但我需要的寬度要靈活。我似乎無法弄清楚這一點,我認爲這將是一個用於Excel的Applescript命令來鎖定寬高比。
這是當前的AppleScript我使用的實際圖像導入:
tell application "Finder"
set imageFolder to "Macintosh HD:Users:adlife:Desktop:Temporary_Image_Hold - Copyright Filings"
end tell
tell application "Finder"
set imageList to files of folder imageFolder
end tell
tell application "Microsoft Excel"
set imageHeight to 100
set imageWidth to 100
set imageCount to count of imageList
set theRange to active cell of worksheet 1 of workbook 1
set thisStep to 0
set theLeft to left position of active cell
repeat with imageFile in imageList
set theTop to (top of active cell)
set newPic to make new picture at beginning of worksheet 1 of workbook 1 with properties {file name:(imageFile as text), height:imageHeight, width:imageWidth, top:theTop, left position:theLeft, placement:placement move}
set thisStep to thisStep + 1
end repeat
end tell
我在埃爾卡皮坦
運行的Microsoft Excel 2011在這裏的任何幫助將不勝感激!
謝謝!
所以,我只是想出了一個解決方法... 在將圖像插入到我的excel之前,我設置了一個蘋果腳本來運行Photoshop動作,它打開圖像,調整它的大小然後將統一的填充添加到圖像的兩側。這樣,插入到excel中的所有jpegs都是相同的大小 - 只是它們中的一些在邊上有空白區域,有些則不會影響excel數據,所以我們很好走! 我仍然有興趣學習這純粹與AppleScript,但如果你們中的任何一個知道如何! –