• 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
Store Script Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Store Script Problem


  • Subject: Store Script Problem
  • From: Dave <email@hidden>
  • Date: Fri, 13 Nov 2015 14:01:46 +0000
  • X_v_e_cd: 0b0eb8b95490d79372d349aeccde37e5
  • X_v_r_cd: 26d1d199b9b68a3a54d8e8813800afbd

Hi,

I’m trying to save a .applescript file into complied .scpt file and then load it. Please see the following Handler:

on CompileAndSaveFile(theScriptFileBaseFolderPath, theScriptFileName)
	my LogFileWrite(gLogFileRef, "CompileAndSaveFile() Enter" & return)
	my LogFileWrite(gLogFileRef, "theScriptFileBaseFolderPath: " & theScriptFileBaseFolderPath & return)
	my LogFileWrite(gLogFileRef, "theScriptFileName: " & theScriptFileName & return)

	set mySourceFileName to theScriptFileName & ".applescript"
	set myDestFileName to theScriptFileName & ".scpt"

	tell application "Finder"
		set myScriptFilePathName to theScriptFileBaseFolderPath & mySourceFileName
		set myCompiledScriptPathPath to theScriptFileBaseFolderPath & myDestFileName

		my LogFileWrite(gLogFileRef, "Creating Script File" & return)
		my LogFileWrite(gLogFileRef, "myScriptFilePathName: " & myScriptFilePathName & return)
		my LogFileWrite(gLogFileRef, "myCompiledScriptPathPath: " & myCompiledScriptPathPath & return)

		store script file myScriptFilePathName in file myCompiledScriptPathPath replacing yes
	end tell

	my LogFileWrite(gLogFileRef, "CompileAndRunScriptFile Return")
	return myCompiledScriptPathPath
end CompileAndSaveFile


I run this and the paths are as follows:

myScriptFilePathName:        JaundicedOutlook:Documents:Development:Projects:TestAS:AppleScriptHandlers:LTWAppleScriptHandlerOutlook.applescript
myCompiledScriptPathPath: JaundicedOutlook:Documents:Development:Projects:TestAS:AppleScriptHandlers:LTWAppleScriptHandlerOutlook.scpt

The .applescript file exists and compiles in the Script Editor, but when I run my script, I get this error:

Run Error Number: -1700
Message: Finder got an error: "Can’t make file JaundicedOutlook:Documents:Development:Projects:TestAS:AppleScriptHandlers:LTWAppleScriptHandlerOutlook.applescript" into type script.

on the:
	store script file myScriptFilePathName in file myCompiledScriptPathPath replacing yes

Statement.

Any idea how to make this work?

Thanks a lot
All the Best
Dave


 _______________________________________________
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: Store Script Problem
      • From: Christopher Stone <email@hidden>
  • Prev by Date: Re: ip forwarding
  • Next by Date: Re: distinctUnionOfArrays
  • Previous by thread: ip forwarding
  • Next by thread: Re: Store Script Problem
  • Index(es):
    • Date
    • Thread