Newbies Shannon@SM Posted November 29, 2004 Newbies Posted November 29, 2004 Hey, there. A client recently upgraded from OS 9 to OS X. We are using an applescript to move data from Filemaker 6 to MYOB AccountEdge v2. The file path specified is no longer valid given the new directory structure in OS X, but I can't seem to find what the correct path name is? I get an error message "Can't find the file..." when I run the script. I have tried using the path provided by Get Info and have also added the path provided by terminal: pwd, no luck. Help, anyone? sb here's the problem part of what we have: property MYOB_Data_FilePath : "Orion:Server:A Accounting/Invoicing Stuff:ATM Inc. Data/V9" tell application "FileMaker 6.0v4" activate open MYOB_Data_FilePath as alias given
Fenton Posted November 29, 2004 Posted November 29, 2004 Your path has both old style Mac dividers ":" and Unix dividers "/". AppleScript uses the old style ":". You can convert Unix to Mac, or Mac to Unix. These 2 lines show how: set PX to POSIX path of (choose file) -- Mac path to Unix ("choose file" returns a Mac path) set theMac to POSIX file PX -- Unix to Mac (PX is a variable with a POSIX path in it) (PX above is a file reference, add "as string" if you want text) I don't know about your raw <<class usrn>>, etc.. FileMaker 6 only has a password. For example, this is a droplet app, for opening dropped files: on open (theFiles) tell application "FileMaker Pro" activate open theFiles with password "Howdy" end tell end open FileMaker 7 has an Account and a password (but they are plural; don't know why): on open (theFiles) tell application "FileMaker Developer" activate open theFiles with passwords "Howdy" for Accounts "fenton" end tell end open I have FileMaker Pro 6 and FileMaker Developer 7, so there's no conflict between them. If you have FileMaker Pro 6 & 7, then you need to do this: on open (theFiles) tell application "Finder" ignoring application responses launch application file id "FMP5" end ignoring tell application "FileMaker Pro" activate open theFiles with password "Howdy" end tell end tell end open And they'll still be confusion if both are open.
Newbies Shannon@SM Posted November 29, 2004 Author Newbies Posted November 29, 2004 cool, let me give this a shot. thanks for the feedback.
mindtpi99 Posted November 30, 2004 Posted November 30, 2004 When I want to find a path name I just create a script like choose folder or choose file And then just copy the path from the result window
Fenton Posted November 30, 2004 Posted November 30, 2004 Another little method, to get the path from a file in a visible window, is to create a script file, then put it in your Scripts folder (which should be in your menu bar, if you've turned that feature on; if not, look in the Help, it can do it for you). Then, when you need the path, click once on the file, and run the script. The path will be on the clipboard. It just does one file - one path. 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
Recommended Posts
This topic is 7297 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 accountSign in
Already have an account? Sign in here.
Sign In Now