?
Solved

Applescript: open word file on remote server

Posted on 2013-11-14
2
Medium Priority
?
1,277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
heteronymous earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

The Basics of Storyboard Storyboards were first introduced to developers in the release of iOS 5. They save the developer the trouble of designing each screen’s interface in a different file. The storyboard allows you to see the conceptual mockup o…
The release of the iPhone 6 and the iPhone 6 Plus was extremely successful for Apple. However when iOS 8.1 was introduced, many iPhone users complained of quick battery drainage. Without even knowing, you may be unnecessarily using up your battery p…
This video walks the viewer through the process of creating a watermark for their document, customizing it, and saving it for viewing/printing needs.
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
Suggested Courses

764 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