-
1. Re: Windows Servers - JavaScript
KevinPowell_Art Sep 19, 2011 1:45 PM (in response to KevinPowell_Art)var myDocument = app.open(File("FILE STRUCTURE HERE"/thumbnail_array.indt"));
The server file structure is the code I am fighting with. What is the proper way to write this?
-
2. Re: Windows Servers - JavaScript
Harbs. Sep 19, 2011 1:45 PM (in response to KevinPowell_Art)Can you post an example of what you tried?
-
3. Re: Windows Servers - JavaScript
Harbs. Sep 19, 2011 2:02 PM (in response to KevinPowell_Art)The easiest way to get that is to browse for the file in ESTK and check the URI (or native path).
File.openDialog("gimme a file");
-
4. Re: Windows Servers - JavaScript
reddirt66 Sep 19, 2011 7:17 PM (in response to KevinPowell_Art)I'll have to get the example file and post it tomorrow.
openDialog defeats the purpose of the script so that is not an option. If I wanted people searching for files I would just have them search for files and keep moving them into wrong places.
I was simply looking for the filing structure for windows because it is not clearly documented. Eithere poit toward some documentation or some quick example code. Mac on the other hand works like a charm. Unfortunately I have to work off of the windows server. works fine through the local windows machine but is having problem accessing the network.
I would just like to see how you are suppose to write the path and I'll fill in the rest:
var myDocument = app.open(File(PATH+"thumbnail_array.indt"));
PATH for a windows server is all I am looking for.
-
5. Re: Windows Servers - JavaScript
Harbs. Sep 19, 2011 10:20 PM (in response to reddirt66)My point was not to include File.openDialog() in the script.
My point was for you to use it to browse what the path appears in the File object.
Harbs
-
6. Re: Windows Servers - JavaScript
Haakenlid Sep 19, 2011 11:53 PM (in response to reddirt66)Try to run this. It'll show the path of the file you select in the dialog.
alert(File.openDialog("gimme a file").fullName); -
7. Re: Windows Servers - JavaScript
reddirt66 Sep 20, 2011 3:34 AM (in response to Haakenlid)I have tried both of those methods and it works for the Mac and not Windows. Neither method helped which is what I ask the simple question - How would you write it if you were connecting to a windows server?
Thanks for the responses and I will provide an example in a couple of hours.
-
8. Re: Windows Servers - JavaScript
Haakenlid Sep 20, 2011 3:53 AM (in response to reddirt66)reddirt66 wrote:
I have tried both of those methods and it works for the Mac and not Windows. Neither method helped which is what I ask the simple question - How would you write it if you were connecting to a windows server?
Thanks for the responses and I will provide an example in a couple of hours.
How did the openDialog() method fail in windows? Did you get an error message?
Something like this should work if you get the correct filepath, and you should be able to find the correct filepath by using openDialog();var myDocument = app.open(File("/D/folder/subfolder/thumbnail_array.indt")); -
9. Re: Windows Servers - JavaScript
KevinPowell_Art Sep 20, 2011 5:32 AM (in response to Haakenlid)This was my first attempt (I also tried the // between each and \
var myDocument = app.open(File("/F/Atlfs01/groups/AssetManagement/Public/Projects_Products/Image Library/~Article Thumbnails/~THUMBNAIL_TEMPLATES/temps/thumbnail_array.indd")); This is what openDialog gave me:
//Atlfs01/groups/AssetManagement/Public/Projects_Products/Image Library/~Article Thumbnails/~THUMBNAIL_TEMPLATES/temps/thumbnail_array.indd
var myDocument = app.open(File("//Atlfs01/groups/AssetManagement/Public/Projects_Products/Image Library/~Article Thumbnails/~THUMBNAIL_TEMPLATES/temps/thumbnail_array.indd")); -
10. Re: Windows Servers - JavaScript
Harbs. Sep 20, 2011 5:37 AM (in response to KevinPowell_Art)Okay. Now we have some info...
You are talking about a mounted network volume. You did not state that earlier. I have no experience with mounted Windows network volumes. How would you address a file using the command prompt in Windows?
Try removing the extra forward slash before Atlfs01.
Harbs
-
11. Re: Windows Servers - JavaScript
KevinPowell_Art Sep 20, 2011 5:45 AM (in response to Harbs.)Thanks Harbs, I have also removed the extra forward slazh with no avail.
This is the command prompt:
\\Atlfs01\groups\AssetManagement\Public\Projects_Products\Image Library\~Article Thumbnails\~THUMBNAIL_TEMPLATES
-
12. Re: Windows Servers - JavaScript
Haakenlid Sep 20, 2011 5:52 AM (in response to KevinPowell_Art)Seems like there could be several things that could cause problems.
There is an extra space beween "u" and "c" in "Projects_Produ cts", is that in your script as well
Is your file INDD or INDT?
Are the ~ characters part of the folder names? It seems unusual. That is often a reserved character in paths.
Can you try to put the indesign file in the folder "groups". If you can reach it there, the problem must be somewhere later in the path string.
Sometimes you need to replace spaces in file paths with "%20", that might be worth a try.
If you have the correct path you can check if File("path").exists === true, that's simpler than trying to open it with indesign. -
13. Re: Windows Servers - JavaScript
Marijan Tompa Sep 20, 2011 5:51 AM (in response to KevinPowell_Art)Kevin,
Try this:
var myDocument = app.open(File("\\\\Atlfs01\\groups\\AssetManagement\\Public\\Projects_Products\\Image Library\\~Article Thumbnails\\~THUMBNAIL_TEMPLATES\\temps\\thumbnail_array.indd"));
Hope that helps.
--
Marijan (tomaxxi)
-
14. Re: Windows Servers - JavaScript
KevinPowell_Art Sep 20, 2011 6:01 AM (in response to Haakenlid)Thank you for the File("path").exists === true test... I am just going through options. The space was not there and %20 did not work as well.
Using exists to test options
-
15. Re: Windows Servers - JavaScript
KevinPowell_Art Sep 20, 2011 6:32 AM (in response to KevinPowell_Art)It reads the file at the root level but not any further. I think it is a permissions issue.
-
16. Re: Windows Servers - JavaScript
Haakenlid Sep 20, 2011 6:53 AM (in response to KevinPowell_Art)If you can open the file using openDialog(), then it should not be a permission issue.
I suspect that the tilde (~) in the folder name might cause problems.
It's often used as substutition for the User folder in windows. like this: Folder("~/Desktop"), which points to the desktop folder of the currently logged in user.But that's just a guess. If you have permission to rename the folders with tilde I would give it a try.
-
17. Re: Windows Servers - JavaScript
KevinPowell_Art Sep 20, 2011 6:58 AM (in response to Haakenlid)File("/S/AssetManagement/Public/Projects_Products/Image Library/~Article Thumbnails/~THUMBNAIL_TEMPLATES/temps/array_template.indd").exists === true
The group name was causing issue.
THIS WORKS - THANK YOU EVERYONE!!!
This also works
File("S:/AssetManagement/Public/Projects_Products/Image Library/~Article Thumbnails/~THUMBNAIL_TEMPLATES/temps/array_template.indd").exists === true
-
18. Re: Windows Servers - JavaScript
KevinPowell_Art Sep 20, 2011 8:10 AM (in response to KevinPowell_Art)Issue 2 came up where some computers had it mapped to a different drive letter. I retested with the group name and the / and it works now,
File("//Atlfs01/groups/AssetManagement/Public/Projects_Products/Image Library/~Article Thumbnails/~THUMBNAIL_TEMPLATES/temps/array_template.indt").exists === true
Thanks Again



