Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Applescript: open word file on remote server

Posted on 2013-11-14
2
Medium Priority
?
1,309 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
This video shows where to find templates, what they are used for, and how to create and save a custom template using Microsoft Word.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

649 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