Solved

Applescript: open word file on remote server

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

When Apple released Swift last year, the aim was to introduce a new programming language for Cocoa and Cocoa Touch that was fast, easy and effective, like the name connotes. Apple succeeded. Swift is designed to couple with Objective-C program…
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.

760 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now