Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6128 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I'd like to open a folder that is located on a windows2000 pc, and i would like to be able to open it on both pc and apple clients...is this possible ? The pc-client-part is no problem...

Sorry for my bad english, i'm from belgium.

Posted

If you've got the PC part working, the Mac part is also not too difficult. There is a question however. AppleScript can either "open" the folder, or "reveal" a file in the folder. The latter is a better choice if you have a file, because it opens the folder, scrolls to and highlights the file. (I don't know if there is a PC equivalent.)

First you will need a Mac style file path; looks like:

File: "Macintosh HD:Users:fej:Desktop:Donuts:Jelly.jpg"

Folder: "Macintosh HD:Users:fej:Desktop:Donuts:"

I'm going to assume you have that path in a calculation field (so you can see it).


set theFile to cell "z_cPath_OS" of current record



tell application "Finder"

activate

reveal file theFile

end tell


or





set theFolder to cell "z_cFolderPath_OS" of current record



tell application "Finder"

activate

open folder theFolder

end tell

Alternatively you can include the whole shebang in a FileMaker calculation. Just remember to escape quotes so they still show up in the result. Then you can use Perform AppleScript, and check the (•) Calculation option.

Once again, I recommend doing calculations in such a way that you can preview the results. The slightest mistake in a path breaks these operations.

  • Newbies
Posted (edited)

but the folder i want to open on the apple-client is really on a pc...

how does the path look like then ?

I managed to open a local folder on the mac (Macintosh HD:WPRO)

how can i open a folder from a mounted network drive ?

Edited by Guest
Posted (edited)

I don't have any way to test opening a file on a Windows server, as I don't have access to one. But I would think that if you can open a file on it using the Finder, you could open it with AppleScript. What you need is the Mac syntax of the path. Try running this AppleScript, to get the path. Select the file first in the Finder, then run this script. If you use it often, put it (as a file) in a folder of your Scripts menu in the Menu Bar (if you have it turned on, it's a little AppleScript icon).*


tell application "Finder"

	try

		set theFiles to get selection

		set theFile to item 1 of theFiles

		set the clipboard to theFile as string

	on error errmsg number errnum

		beep

		display dialog errmsg & " " & errnum buttons {"OK"} default button 1 with icon caution

	end try

end tell

*If you don't, look in your Applications folder, in the AppleScript folder. There is an "AppleScript Utility.app" which I believe turns it on (I've had it on like forever). The Scripts menu has several folders, for different applications. You'd want to put this one in the Finder's folder, as you'd only use it while in the Finder.

Edited by Guest

This topic is 6128 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.