2013-10-25 101 views
0

如何修改此腳本以查找多個屏幕分辨率的圖像?現在它檢查一個屏幕分辨率(640x1136),但我也想檢查640x960和1024x768。檢查多個屏幕分辨率

on run {input, parameters} 

    set picFolder to alias "Users:colind:Dropbox:Camera Uploads:" 
    set screenshotFolder to alias "Users:colind:Dropbox:Camera Uploads:Screenshots:" 

    tell application "System Events" 
     set photos to path of files of picFolder whose kind is "Portable Network Graphics image" 
    end tell 

    set screenshots to {} 
    repeat with imgPath in photos 
     set imgAlias to alias imgPath 
     tell application "Image Events" 
      set img to open imgPath 
      if dimensions of img = {640, 1136} then 
       set end of screenshots to imgAlias 
      end if 
      close img 
     end tell 
    end repeat 

    tell application "Finder" 
     move screenshots to screenshotFolder 
    end tell 


    return input 
end run 

回答

1

你應該能夠到,如果行更改爲:

if ((dimensions of img = {640, 1136}) or (dimensions of img = {640, 960}) or (dimensions of img = {1024, 768})) then