2006/11/08

RubyOSA 0.1 のFinderを試す

# Finder をアクティブにする

tell the application 'Finder' to activate

は、RubyOSA だと

OSA.app('Finder').activate

#home 以下全フォルダ名の取得 --get all folder's name of path to home

tell the application 'Finder'
  return name of folders of home
end tell

は、RubyOSA だと

OSA.app('Finder').home.folders.to_a.each{ |folder| puts folder.name }

#Desktop 上の全ファイル名の取得

tell the application 'Finder' to name of every document file in the desktop

は、RubyOSA だと

require 'nkf'
OSA.app('Finder').document_files.each{ |file| puts NKF.nkf('-w -Lu', file.name)}

end

--imported_from
http://www.midore.net/daybook/2006/11/1162972588.html


+++ 追記 +++
2010-02-06

関連する記事
"RubyOSA"ラベルがついた全ての記事

0 件のコメント: