Solved

Applescript: open word file on remote server

Posted on 2013-11-14
2
1,190 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I recently went through the process of creating an installable image of an iPhone mobile app (an .ipa file) that beta testers could load onto their test devices. The process involved quite a few steps, but both Appcelerator and Diawi.org had decent …
     Intro      In this article, I will show you how to parse a JSON in Swift using an open source library called SwiftyJSON (https://github.com/SwiftyJSON/SwiftyJSON). If you haven't heard of a JSON before, it stands for JavaScript Object Notation…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.

831 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