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

Re: Load Script Problem


  • Subject: Re: Load Script Problem
  • From: Dave <email@hidden>
  • Date: Fri, 13 Nov 2015 17:30:37 +0000

Thanks Shane,

I posted this to a different thread but I wondered if you could spot the problem:

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
> On 13 Nov 2015, at 02:02, Shane Stanley <email@hidden> wrote:
>
> On 13 Nov 2015, at 1:00 PM, Shane Stanley <email@hidden> wrote:
>>
>> Because it's within an Xcode project, there are some extra complications. The load script command will need to be targeted at the current application (tell current application to set myTargetOutlookScript to ...).
>
> I take that back -- it's the normal read and write commands that require that. Nonetheless, I believe store script doesn't work regardless.
>
> --
> Shane Stanley <email@hidden>
> <www.macosxautomation.com/applescript/apps/>
>
>
> _______________________________________________
> 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


 _______________________________________________
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: Load Script Problem
      • From: Shane Stanley <email@hidden>
References: 
 >Load Script Problem (From: Dave <email@hidden>)
 >Re: Load Script Problem (From: Shane Stanley <email@hidden>)
 >Re: Load Script Problem (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: AppleScript-Users Digest, Vol 12, Issue 551
  • Next by Date: IP forwarding
  • Previous by thread: Re: Load Script Problem
  • Next by thread: Re: Load Script Problem
  • Index(es):
    • Date
    • Thread