Created
March 20, 2015 16:02
-
-
Save tomoyanonymous/5abffe7abc38a218e20a to your computer and use it in GitHub Desktop.
Max/MSPでアプリ化しても使えるカレントディレクトリを吐き出すjsオブジェクト用ファイル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inlets = 1; | |
outlets = 1; | |
autowatch = 1; | |
function patchPath() | |
{ | |
var patchPath = this.patcher.filepath; | |
var patchName = this.patcher.name + '.maxpat'; | |
if(patchPath != patchName){ | |
var lastSeparatorIndex = patchPath.lastIndexOf(patchName); | |
var folderPath = patchPath.slice(0,lastSeparatorIndex); | |
}else{ | |
var folderPath = max.apppath; | |
} | |
outlet(0,folderPath); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment