On Jun 16, 2011, at 14:54, Nielsen, Karen S. (Schmidt) wrote: I can successfully run the script on my Mac but when tried on other Macs with the same setup, the library reference fails. Any ideas?
______________________________________________________________________
Hey Karen,
Just guessing but I'd say you've hard-coded your path strings, and this is bound to fail at some point when you play musical machines.
------------------------------------------------------------------------------------------------ set p to "Applications:test.txt" set f to file p
--> Error: Can’t get file "Applications:test.txt"
set p to "Thor:Applications:test.txt" --> actual hfs path set f to file p
--> Error: Can’t get file "Thor:Applications:test.txt".
set f to alias p read f
# Works fine.
set testFilePath to ((path to applications folder) as text) & "test.txt" read alias testFilePath
# This will handle a move to any Mac as long as 'test.txt' is in the Applications Folder.
# For my own use I prefer to write this as an implicit coercion:
set testFilePath to "" & (path to applications folder) & "test.txt" ------------------------------------------------------------------------------------------------
I generally find it better practice to use 'alias' rather than 'file'.
You're only using a partial path here.
set oracle_script_path to "Applications:ORACLE:OracleScriptLibraries:FinderLib_Oracle.scpt"
So I'm wondering how that's getting resolved and working for you at all. Possibly a relative path?
Hmm. Interesting. I can get this to run using both Script Debugger and Smile but not the Applescript Editor: ------------------------------------------------------------------------------------------------ try set libPath to "Applications:lib1.scpt" set libPathFile to load script file libPath tell libPathFile to bp(2) on error errMsg number errNum set sep to "==============================" set e to sep & return & "Error: " & errMsg & return & sep & return ¬ & "Error Number: " & errNum & return & sep beep e end try ------------------------------------------------------------------------------------------------
-- Best Regards, Chris
|