• 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: How do I prevent dialogs? and other questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I prevent dialogs? and other questions


  • Subject: Re: How do I prevent dialogs? and other questions
  • From: kai <email@hidden>
  • Date: Sun, 28 Sep 2003 17:54:23 +0100

on Sat, 27 Sep 2003 23:43:19 -0500, Bert Knabe wrote:

> Because I wanted to use Cron I created an applet that invokes the
> "Enable Folder Actions" script. I created an invoking applet because
> turning "Enable Folder Actions" into an applet resulted in a dialog
> appearing asking if it should run or quit (run is the default). I need
> it to run without having to be watched. How do I prevent the appearance
> of the dialog? I don't have any user interaction in my script. Does
> Applescript assume you want input in applets unless you expressly say
> that you don't?

Well yes - in a way, Bert. You can avoid this when you save a script as an
application, by just making sure that the "Never Show Startup Screen" option
is checked.

> Here is the invoking script:
>
> tell application "Finder"
> set old_delimiters to AppleScript's text item delimiters
> set AppleScript's text item delimiters to ":"
> activate "Server HD:Library:Scripts:Folder Actions:Enable Folder
> Actions.scpt"
> set AppleScript's text item delimiters to old_delimiters
> end tell

A couple of other general points:

The text item delimiter stuff doesn't seem to serve any useful purpose here.
They're just set and then reset. To use text item delimiters, you need to
set them - and then use statements like 'text items of [someString]' (which
produces a list) or '[someList] as string' (which results, curiously enough,
in a string).

Because the activate command is in a Finder tell block, all that happens
here is that the Finder activates. The string "Server HD: etc." is
apparently ignored.

You really don't even need the Finder. To invoke another script, you can
just use 'run script' - something like this (one line):

----------
run script "Server HD:Library:Scripts:Folder Actions:Enable Folder
Actions.scpt"
----------

---
kai
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Bug in (scripting) Excel.
  • Next by Date: [ANN] AppleScript for Absolute Starters (AS4AS)
  • Previous by thread: Re: How do I prevent dialogs? and other questions
  • Next by thread: [ANN] AppleScript for Absolute Starters (AS4AS)
  • Index(es):
    • Date
    • Thread