Bringing a script from 9 into OSX and having difficulty... HELP!

I needed to get and old script going to move data from a Filemaker Pro file into a Quark file. This worked fine for quite some time, but the computer on 9.1 is going away. I need it to work on OSX 10.4 and it errors at several point… can anyone give me pointers of what needs to change?

tell application “FileMaker Pro”
open “Erdelt HD:AdvTextPrgm:AdText.fp7”
tell document 1
set x to cell “Event” of record 1
end tell
end tell

tell application “QuarkXPress”
open ¬
“Erdelt HD/AdvTextPrgm/AdvTextSupportÆ’/Cir.Text Work Pg." remap fonts no do auto picture import no use doc prefs yes tell application "QuarkXPress" to set import styles to false tell document 1 set story 1 to alias "Erdelt HD:AdvTextPrgm:AdvTextSupportÆ’:Textported”
tell story 1
set (every text where it is “<\n>”) to return
save in alias “Erdelt HD:AdvTextPrgm:AdvTextSupportÆ’:TempText" end tell tell application "QuarkXPress" to set import styles to true set story 1 to alias "Erdelt HD:AdvTextPrgm:AdvTextSupportÆ’:TempText”
set Filepath to ("Erdelt HD:AdvTextPrgm:NewQuarkTextFiles:AdvText " & x)
tell application “QuarkXPress”
save document 1 in Filepath with replacing
close document 1 saving no
end tell
tell application “Finder”
set file type of alias Filepath to “XDOC”
end tell
end tell
end tell

Hello

My guess is that every hardcoded pathname must be edited because they are written for a disk organised the OS9 way.

If you are working with a single Hard Disk I assumes that the pathname would be something like:
“Erdelt HD:Users::Documents:822996.rtf”

which may be built thru

set docuFolder to (path to documents folder from user domain) as Unicode text

set path1 to docuFolder & “822996.rtf”

Assuming that I am right this will give something like:

set docuFolder to path to documents folder from user domain

tell application "FileMaker Pro"
    open docuFolder & "AdvTextPrgm:AdText.fp7"
    tell document 1
        set x to cell "Event" of record 1
    end tell
end tell

tell application "QuarkXPress"
    open ¬
        docuFolder & "AdvTextPrgm:`AdvTextSupportÆ’:Cir.Text Work Pg." remap fonts no do auto picture import no use doc prefs yes
    tell application "QuarkXPress" to set import styles to false
    tell document 1
        set story 1 to alias docuFolder & "AdvTextPrgm:`AdvTextSupportÆ’:Textported"
        tell story 1
            set (every text where it is "<\\n>") to return
            save in alias docuFolder & "AdvTextPrgm:`AdvTextSupportÆ’:TempText"
        end tell
        tell application "QuarkXPress" to set import styles to true
        set story 1 to alias docuFolder & "AdvTextPrgm:`AdvTextSupportÆ’:TempText"
        set Filepath to (docuFolder & "AdvTextPrgm:NewQuarkTextFiles:AdvText " & x)
        tell application "QuarkXPress"
            save document 1 in Filepath with replacing
            close document 1 saving no
        end tell
        tell application "Finder"
            set file type of alias Filepath to "XDOC"
        end tell
    end tell
end tell

CAUTION, with Mac OS X I’m not sure that inserting periods in filenames is a good idea because the period is the name extension delimiter

Yvan KOENIG (from FRANCE jeudi 5 octobre 2006 20:36:8)

Thanks Yvan;

More than just the paths, – open “Erdelt HD:AdvTextPrgm:AdText.fp7”-- works just fine…
the line – set x to cell “Event” of record 1 –
errors on – cell “Event”–, so I don’t know if it is script terminology or within Filemaker Pro???

Hello

I just tested with the demo version.
Assuming that the database is already open,


tell application "FileMaker Pro"
	tell database 1
		set vv to cell "désignation" of record 3
	end tell
end tell

works.

Yvan KOENIG (from FRANCE vendredi 6 octobre 2006 08:00:16)

Thanks Again Yvan! I will keep working, but it looks good.

You are a blessing to those in need! Paul