• 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: scrpting Script Editor (save as script)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scrpting Script Editor (save as script)


  • Subject: Re: scrpting Script Editor (save as script)
  • From: Axel Luttgens <email@hidden>
  • Date: Sat, 12 Jan 2008 09:54:47 +0100

On 12/01/08 8:58, Yvon Thoraval wrote:

My goal :

save a bunch of Applescript scripts already saved in text form
(.applescript extension) as scripts (.scpt extension.

I've tried :
tell application "Script Editor"
activate
open aFile
delay 1
set frontmost to true
try
-- save window 1 as script in my getAlias(aFile)
-- Erreur dans Éditeur de scripts : NSReceiversCantHandleCommandScriptError
-- save window 1 as script
-- Erreur dans Éditeur de scripts : NSReceiversCantHandleCommandScriptError
-- save window 1 as "script"
-- Erreur dans Éditeur de scripts : NSReceiversCantHandleCommandScriptError
tell window 1 to save as script in my getAlias(aFile)
-- Erreur dans Éditeur de scripts : NSReceiversCantHandleCommandScriptError
on error errMsg
display dialog errMsg
end try
close window 1
end tell


getting allways "NSReceiversCantHandleCommandScriptError" even if,
before saving, the Finder makes the new file.

here am i wrong ?

the purpose being to save a *.applescript file in a "*.scpt" file...

Looks like one saves a window's document, not the window itself. On the other hand, the as parameter is defined as a string. So,

tell application "Script Editor" to save document of front window as "script"

shoud be more compliant with SE's dictionary.

HTH,
Axel
_______________________________________________
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: scrpting Script Editor (save as script)
      • From: "Yvon Thoraval" <email@hidden>
References: 
 >scrpting Script Editor (save as script) (From: "Yvon Thoraval" <email@hidden>)

  • Prev by Date: scrpting Script Editor (save as script)
  • Next by Date: Re: scrpting Script Editor (save as script)
  • Previous by thread: scrpting Script Editor (save as script)
  • Next by thread: Re: scrpting Script Editor (save as script)
  • Index(es):
    • Date
    • Thread