• 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
Fwd: How do I know when an open "is finished to run" ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: How do I know when an open "is finished to run" ?


  • Subject: Fwd: How do I know when an open "is finished to run" ?
  • From: KOENIG Yvan <email@hidden>
  • Date: Wed, 12 Dec 2007 15:34:59 +0100


Le 10 déc. 07 à 17:20, Emile Schwarz a écrit :

tell application "Finder"
   -- get a reference to the item I want to open
   set TargetItem to item 1 of front window

   -- get a reference as alias to this file
   set CompactedItem to TargetItem as alias

   -- open the compacted item (decompress the file)
   open CompactedItem

   -- Here I have the problem
end tell


Hello Emile

It seems that the problem is that when it opens an Archive, the Finder is not returning a result so my current tip is not usable.


set TargetItem to choose file

tell application "Finder"
	-- get a reference to the item I want to open
	-- set TargetItem to item 1 of front window

	-- get a reference as alias to this file
	set CompactedItem to TargetItem as alias

	-- open the compacted item (decompress the file)
	set expf to open CompactedItem
	set eSize to physical size of expf
	repeat
		if physical size of expf = eSize then exit repeat
		set eSize to physical size of expf
	end repeat
	-- Here I have the problem
end tell


Running it I get:

tell application "Finder"
	open alias "Macintosh HD:Users:yvankoenig:Desktop:divorce.zip"
		"La variable expf n’est pas définie."

I tried to call directly the apps really doing the expansion task:


set TargetItem to choose file

tell application "Finder"
	-- get a reference to the item I want to open
	-- set TargetItem to item 1 of front window

	-- get a reference as alias to this file
	set CompactedItem to TargetItem as alias

	-- open the compacted item (decompress the file)
	set nameExt to name extension of CompactedItem
	if nameExt is "zip" then
		set opener to "BOMArchiveHelper"
	else if nameExt is "dmg" then
		set opener to "DiskImageMounter"
	else
		set opener to ""
	end if
end tell -- to Finder
if opener is not "" then
	tell application opener
		set expf to open CompactedItem
	end tell
	tell application "Finder"
		set eSize to physical size of expf
		repeat
			if physical size of expf = eSize then exit repeat
			set eSize to physical size of expf
		end repeat
		-- Here I have the problem
	end tell -- to Finder
end if

but they don't send a result so the problem is always here.

Yvan KOENIG

_______________________________________________
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
  • Prev by Date: Re: Can any AppleScript become a Cocoa App in Xcode?
  • Next by Date: Re: How do I know when an open "is finished to run" ?
  • Previous by thread: Re: How do I know when an open "is finished to run" ?
  • Next by thread: Re: "Text Events" FBA [Was: Re: What makes appleScript COOL!]
  • Index(es):
    • Date
    • Thread