• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: InDesign Script that references a script library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: InDesign Script that references a script library


  • Subject: Re: InDesign Script that references a script library
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 17 Jun 2011 00:14:45 -0500

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

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • RE: InDesign Script that references a script library
      • From: "Nielsen, Karen S. (Schmidt)" <email@hidden>
References: 
 >InDesign Script that references a script library (From: "Nielsen, Karen S. (Schmidt)" <email@hidden>)

  • Prev by Date: Re: InDesign Script that references a script library
  • Next by Date: error
  • Previous by thread: Re: InDesign Script that references a script library
  • Next by thread: RE: InDesign Script that references a script library
  • Index(es):
    • Date
    • Thread