Change Project Folder automatically if present


/ Published in: Maxscript
Save to your folder(s)

When placed in startup scripts, this snippet activates every time user opens a file. It then traverses the directory path backwards and looks for user created project folders. If one is found, script offers to switch it on.

This is very useful when working with a number of projects at a time.


Copy this code and paste it in your HTML
  1. callbacks.addScript #filePostOpen "phTraverseProjectPath()" id:("phTraverseProjectPath" as name)
  2.  
  3. fn phTraverseProjectPath = (
  4.  
  5. curPath = maxFilePath
  6. queryAnswer = false
  7.  
  8. for i = 1 to 15 do (
  9. if curPath == "" do continue;
  10. if pathConfig.isProjectFolder curPath then (
  11. if (pathConfig.getCurrentProjectFolder() != curPath) do (
  12. if (queryAnswer == false) do (
  13. if (queryBox ("Change Project Folder?\n" + (curPath as String))) do (
  14. pathConfig.setCurrentProjectFolder curPath
  15. )
  16. queryAnswer = true
  17. )
  18. )
  19. )
  20. curPath = pathConfig.removePathLeaf curPath
  21. )
  22.  
  23. )

URL: http://karkijoukkue.fi

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.