Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Applescript > Re: Finder keep...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 2 Topic 1602 of 1612
Post > Topic >>

Re: Finder keeps popping to foreground

by "harshman@[EMAIL PROTECTED] " <harshman@[EMAIL PROTECTED] > Apr 24, 2008 at 08:56 PM

Hmm, moving the Safari code to a "on removing" block (the UNIX server
issues FTP delete commands to clear the XML once it sees a response
XML file indicating everything's been processed) seems to have done
the trick:

on removing folder items from this_folder after losing these_items
	tell application "Safari" to activate
	tell application "System Events"
		tell process "Safari"
			click menu item "Shipping Workstation" of menu "Window" of menu bar
1
		end tell
	end tell
end removing folder items from



On Apr 24, 8:48=A0pm, "harsh...@[EMAIL PROTECTED]
" <harsh...@[EMAIL PROTECTED]
> wrote:
> We have a semi-convoluted setup where we have a web interface into a
> UNIX server that we access via Safari, feeding it with a handheld
> barcode scanner. =A0That UNIX server, in response to barcode input, FTPs
> an XML file to our Mac workstations, which have a FolderAction
> AppleScript setup that, when an XML file appears, feeds that file to a
> proprietary application running on the Mac (Endicia, for postage),
> which does its thing (spits out a label). =A0After that, I need control
> to pass back to Safari, and =A0the UNIX server's data input form (in the
> Safari window) to have focus. =A0The FolderAction script attached does
> this (kind of clumsily, but it does work), but ... =A0A second or two
> after the Safari window snaps to the foreground, the Finder is
> switched to, necessitating a mouse click back to the Safari window,
> which slows things way down.
>
> What's causing the Finder to shuffle itself to the foreground, and how
> can I prevent it?
>
> Thanks!
>
> on adding folder items to this_folder after receiving added_items
> =A0 =A0 =A0 =A0 try
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 repeat with EachItem in added_items
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 set ItemInfo to info for
E=
achItem
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if not folder of
ItemInfo =
then
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 set
FileEx=
tensionOfItem to name extension of ItemInfo
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if
FileExt=
ensionOfItem is "xml" then
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
=
=A0 =A0 tell application "Endicia"
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
=
=A0 =A0 =A0 =A0 =A0 =A0 process XML file at (POSIX path of EachItem)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0
=
=A0 =A0 end tell
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 end if
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 end if
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 end repeat
> =A0 =A0 =A0 =A0 end try
>
> =A0 =A0 =A0 =A0 tell application "Safari" to activate
> =A0 =A0 =A0 =A0 tell application "System Events"
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 tell process "Safari"
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 click menu item
"Shipping =
Workstation" of menu "Window" of menu bar
> 1
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 end tell
> =A0 =A0 =A0 =A0 end tell
> end adding folder items to




 2 Posts in Topic:
Finder keeps popping to foreground
"harshman@[EMAIL PRO  2008-04-24 20:48:21 
Re: Finder keeps popping to foreground
"harshman@[EMAIL PRO  2008-04-24 20:56:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 7:48:04 CDT 2008.