Re: Attivating the display dialog window
Re: Attivating the display dialog window
- Subject: Re: Attivating the display dialog window
- From: dev_sleidy <email@hidden>
- Date: Mon, 10 Jul 2006 17:21:55 -0400
The problem is that it opens the first file, then displays the
dialog. For the second file the dialog is hidden.
Finder signals that it has a message and I have to click on Finder
to see the dialog window. I would like the dialog in the front of
all the windows.
If you can - provide your code. Thus, allowing others to attempt to
see your results; and, to determine what the cause of your problem(s).
Save the (quick and dirty) code below as an 'application' (with no
check mark in the 'Startup Screen' check box), and drag your graphic
file(s) onto the application.
The code demonstrates 'Michelle Steiner's reference of using 'tell
me' with 'display dialog'.
-----
on open (the_Items) -- Handle items dragged onto this applet.
my handle_items(the_Items)
end open
-- Handler (function) to process selected items.
on handle_items(local_Items)
repeat with i in local_Items -- Cycle through the selected items.
if (not ((info for file (i as string)) is folder)) then -- Process
only file(s), not folder(s).
tell application "Preview" to open i -- Opens file via designated
(via 'Get Info') application. 'Preview' is not scriptable.
my rename_file(i)
end if
end repeat
tell application "Preview" to quit
end handle_items
-- Hander (function) to 'rename' file.
on rename_file(local_i)
tell application "Finder" to set {file_Name, file_path} to
{displayed name of local_i, container of local_i}
tell me to set tResult to (text returned of (display dialog ("Rename
file: " & file_path) default answer file_Name))
try -- Attempt to rename the file.
if (tResult is not equal to file_Name) then tell application
"Finder" to set name of file (local_i as string) to tResult
on error
my rename_file(local_i) -- 'Finder' errors handled.
end try
end rename_file
_______________________________________________
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