Store Script Problem
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