3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AfterEffectsのExtendScriptでFolderクラスのプロパティが返す値まとめ

Posted at

ExtendScriptにて、Folderクラスのプロパティは様々なシステムパスを返してくれます。
仕事柄たまにAfterEffectsのスクリプトを作成するのですが、
毎度どれがどのパスを返すのだったか忘れて調べ直している気がするのでまとめてみました。

###テスト環境
OS : Win7
ExtendScript実行環境 : Adobe After Effects CC 2015.3
実行スクリプトのパス : C:\Program Files\Adobe\Adobe After Effects CC 2015.3\Support Files\Scripts\test.jsx

###結果

//※見やすいようにdecodeしています
With( Folder ) {
    // Class Properties
    decode(appData)		// /c/ProgramData
    decode(commonFiles)	// /c/Program Files/Common Files
    decode(desktop)		// ~/Desktop
    decode(myDocuments)	// ~/Documents
    decode(startup)		// /c/Program Files/Adobe/Adobe After Effects CC 2015.3/Support Files
    decode(current)		// /c/Program Files/Adobe/Adobe After Effects CC 2015.3/Support Files/Scripts
    decode(system)		// /c/Windows/SYSTEM32
    decode(temp)		// /c/Users/username/AppData/Local/Temp
    decode(userData)	// ~/AppData/Roaming
    decode(trash)		// null

    // Object properties(絶対パスの場合)
    decode(startup.fsName)		// C:\Program Files\Adobe\Adobe After Effects CC 2015.3\Support Files
    decode(startup.parent)		// /c/Program Files/Adobe/Adobe After Effects CC 2015.3
    decode(startup.fullName)	// /c/Program Files/Adobe/Adobe After Effects CC 2015.3/Support Files
    decode(startup.name)		// Support Files
    decode(startup.path)		// /c/Program Files/Adobe/Adobe After Effects CC 2015.3
    decode(startup.relativeURI)	// ..
    decode(startup.absoluteURI)	// /c/Program Files/Adobe/Adobe After Effects CC 2015.3/Support Files

    // Object properties(相対パスの場合)
    decode(desktop.fsName)		// C:\Users\username\Desktop
    decode(desktop.parent)		// ~
    decode(desktop.fullName)	// ~/Desktop
    decode(desktop.name)		// Desktop
    decode(desktop.path)		// ~
    decode(desktop.relativeURI)	// ../../../../../Users/username/Desktop
    decode(desktop.absoluteURI)	// ~/Desktop
}

Folder.trashプロパティはMacOSだとゴミ箱のパスが取得出来るらしいのですが、
WindowsOSだとnullが入ってしまうので残念ながら使えないみたいです・・・

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?