Copy link to clipboard
Copied
Does anyone know if there is a way to get a users path to their install directory?
I have script, that creates a new menu item when Indesign starts up. the menu item is clicked, it opens another script.
Right now, I have the path to the second script hardcoded, which works fine:
C:\Program Files (x86)\Adobe\Adobe InDesign CS5.5\Scripts\Scripts Panel\DM_Core\DM_RemoveMenu.vbs
but now I have to give this to other users, and I need to know if there is some way to get the installation path that they have to their indesign.
Ultimately, what I would like to get is this:
C:\Program Files (x86)\Adobe\Adobe InDesign CS5.5\Scripts
I have tried scriptsFolder but that doesn't take me to the right place.
Anyone have any ideas.
Thanks,
This should get you what you want:
...function GetScriptsFolder (){
var scriptsFolder = null;
do{
// On Mac this is a folder inside the app package
var appFolder = Folder.startup;
if (! appFolder.exists){break;}
scriptsFolder = Folder(appFolder + "/Scripts");
while (appFolder.exists && ! scriptsFolder.exists){
appFolder = appFolder.parent;
s
Copy link to clipboard
Copied
Where did you get "scriptsFolder" from? Your current scripts' folder?
Anyway, check how far you come with the standard list: http://jongware.mit.edu/idcs5js/pc_Folder.html
These variables get filled by ID with the correct paths; for anywhere else, you're own your own. Make sure your path is valid under both Mac OS X and under Windoze, as there are a few differences.
Copy link to clipboard
Copied
Note that the path to a script changes when run from the ESTK versus the Scripts Panel.
Copy link to clipboard
Copied
This should get you what you want:
function GetScriptsFolder (){
var scriptsFolder = null;
do{
// On Mac this is a folder inside the app package
var appFolder = Folder.startup;
if (! appFolder.exists){break;}
scriptsFolder = Folder(appFolder + "/Scripts");
while (appFolder.exists && ! scriptsFolder.exists){
appFolder = appFolder.parent;
scriptsFolder = Folder(appFolder + "/Scripts");
}
if (! scriptsFolder.exists){
scriptsFolder = null;
break;
}
}
while (false);
return scriptsFolder;
}
Harbs
Copy link to clipboard
Copied
Thanks all you guys, but Harbs got me closest to where I needed to be. I had to tweak it a little bit, but it set me on the right path.
I would have said thanks earlier, but the forum wasn't letting me reply.
Copy link to clipboard
Copied
Can't you just use:
var appFolder = Folder.startup;
?
--
Marijan (tomaxxi)
Copy link to clipboard
Copied
Only on Windows.