• 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: stay running
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stay running


  • Subject: Re: stay running
  • From: Luther Fuller <email@hidden>
  • Date: Sat, 09 Apr 2011 15:50:39 -0500

On Apr 9, 2011, at 3:10 PM, louie wrote:

I know that there is a check box to make a script stay running when saving the script. I have a script that produces a script. Is there a way in code to make a script stay running?

Are you writing your script to a text file to be compiled by AppleScript Editor?
If so, AppleScript Editor is scriptable and you can do this ...

set sourceName to (displayed name of sourceRef) as text
--
tell application "AppleScript Editor"
launch
open sourceRef -- an alias to the text file containing your new script
if not (exists document sourceName) then
--
error "The source file could not be opened because it is not editable."
end if
set docRef to a reference to first document -- a reference to your new script
if |stayOpen| of projectParams then
save docRef in objectRef as filetype with run only and stay open without startup screen
else
save docRef in objectRef as filetype with run only without stay open and startup screen
end if
close docRef
end tell


 _______________________________________________
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

References: 
 >stay running (From: louie <email@hidden>)

  • Prev by Date: stay running
  • Next by Date: on quit handler
  • Previous by thread: stay running
  • Next by thread: Re: stay running
  • Index(es):
    • Date
    • Thread