• 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
background app won't quit.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

background app won't quit.


  • Subject: background app won't quit.
  • From: Andy Huntington <email@hidden>
  • Date: Mon, 19 Dec 2005 17:51:23 +0000

Hello

I'm pretty new to AS.

I have the following script which I have running in the background.
All the functionality is there: it looks for a disk, when it finds it
it copies the contents of a folder from the disk to the hard disk and
ejects said disk.

My problem comes when I want to quit the script. I have to force quit.
It makes my shutdown hang.

Any advice warmly welcomed :-)

andy



property diskname : "NO NAME"
on idle
	tell application "Finder"
		-- check to see if the disk is mounted
		if exists the disk diskname then
			-- if it's mounted then check the number of files available

			set n to the number of files of folder "100SSMOV" of folder "SSMOV"
of folder "MSAMSUNG" of disk "NO NAME"

			if n = 0 then
				display dialog "The camera is empty."
				eject disk diskname
				return
			end if

			with timeout of 600 seconds
				try
					set theText to display dialog "Camera connected. " & n & "
videos. Name your folder" default answer "My new folder"
					set t to the text returned of theText
					set p to POSIX path of (system attribute "HOME")
					set f to POSIX file (p & "/desktop")
					-- copy the files
					move files of folder "100SSMOV" of folder "SSMOV" of folder
"MSAMSUNG" of disk "NO NAME" to (make new folder at f with properties
{name:(t as text)})

					-- delete the files
					delete files of folder "100SSMOV" of folder "SSMOV" of folder
"MSAMSUNG" of disk "NO NAME" without dialog
					empty trash
					delay 2
					eject disk diskname
					display dialog "It is now safe to remove the disk."
				on error {}
					display dialog "AppleEvent timed out"
				end try
			end timeout
		end if
	end tell
end idle
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: background app won't quit.
      • From: Emmanuel <email@hidden>
  • Prev by Date: Moving/renaming/deleteing unknown files
  • Next by Date: Re: background app won't quit.
  • Previous by thread: Re: Moving/renaming/deleteing unknown files
  • Next by thread: Re: background app won't quit.
  • Index(es):
    • Date
    • Thread