2011年4月27日水曜日

Get Contents In Directory In Python / VBA Of Office for Mac 2011

In VBA of Office for Mac 2011 , to get contents list in a directory,
we might want to use Python via MacScript Function.

Because , built-in function "Dir" has a problem.


Mac版Office2011でファイルリストを取得するには、
MacScript関数から、Pythonを実行するのがいいと思う。

というのも、Dir関数にはバグがあるみたい。
かといって、AppleScriptだと文字化けをするので、日本語には不向き。
あと、AppleScriptは正規表現が使えない。

== Example ==


Dim contentsListText As String

contentsListText = MacScript("do shell script python getContents.py '/subjectivePath/' ")

0 件のコメント: