Solved

Applescript: open word file on remote server

Posted on 2013-11-14
2
1,166 Views
Last Modified: 2013-11-14
Hi experts,

I have the task to open Word files that are located on a Windows 2008 Server from an Apple iMac using Applescript.

Opening locally stored Word files is no problem, that works like:

tell application "Microsoft Word"
    open file "Macintosh HD:test.docx"
end tell


But in my case the file is located on a remote Server, so I tried:

tell application "Microsoft Word"
    open file "smb://myRemoteServer/Path/filename.docx"
end tell

trying that I get the Error message:
file \"smb://myRemoteServer/Path/filename.docx\"" does not understand the message "open"

the same Comes up when trying  
    open "smb://myRemoteServer/Path/filename.docx"
(without "file")

The path is correct: when I try to open the path in Finder, it works well:
tell application "Finder"
   open Location "smb://myRemoteServer/Path/filename.docx"
end tell

then I get the finder with the highlighted file "filename.docx"


Does anybody know how to open Word files that are located on a smb share using Applescript ???

Thanks a lot!!
0
Comment
Question by:Lupo09
2 Comments
 
LVL 9

Accepted Solution

by:
heteronymous earned 500 total points
ID: 39649951
Word doesn't support *making* a client fileshare connection and opening a file over same.
First you have to mount the volume, which you could do via the Finder,
but this is normally done via "mount volume"

By default volumes in Mac OS X are mounted within /Volumes
Unless you already know what you're doing, don't try to circumvent or change this.

See http://hints.macworld.com/comment.php?mode=display&title=Solution%253A+No+Finder+Window&pid=31946

If you have single sign-on, then you might not need to invoke the username & password as shown in that example.

THEN, you need to give Word (or any other app) the *local* path to the file.
Eg:

set Share to "ShareName"
set tFile to "filename.docx"
set filePath to Share & ":" & tFile

tell application "Microsoft Word"
      open filePath
end tell
0
 

Author Closing Comment

by:Lupo09
ID: 39650387
Yeah!
mounting the smb share first was the solution.

Thanks!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
CocoaPods is the best way to manage library dependencies in iOS and OS X projects. By using cocoa pods there is no need of downloading the code from github and copying to your project. There are plenty of open source libraries now available with C…
This video shows and describes the main difference between both orientations in Microsoft Word. Viewers will understand when to use each orientation and how to get the most out of them.
This video shows where to find the word count, how to display it, and what it breaks down to in Microsoft Word.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question