Re: Help needed
Re: Help needed
- Subject: Re: Help needed
- From: Darin Ames <email@hidden>
- Date: Sun, 07 Apr 2002 22:00:44 -0400
Corny,
thanks for the url. The script does almost everything I want except setting
the view to global.
For all of you, here's the script:
-- VIEW MODE
using terms from application "Finder"
property view_mode : icon view -- icon view/list view/column view
end using terms from
-- LIST VIEW OPTIONS
using terms from application "Finder"
property sort_column : name column -- name column/modification date
column/creation date column/size column/kind column/label column/version
column/comment column
property calc_indicator : false -- true/false
property icon_type : small icon -- small icon/large icon
property dates_indicator : false -- true/false
property sort_direction : normal -- normal/reversed
property list_options : {sort column:sort_column, calculates folder
sizes:calc_indicator ,
, icon size:icon_type, uses relative dates:dates_indicator}
end using terms from
-- ICON VIEW OPTIONS
using terms from application "Finder"
property arrangement_method : arranged by name -- arrangement not
arranged/snap to grid/arranged by name/arranged by modification
date/arranged by creation date/arranged by size/arranged by kind/arranged by
label
property icon_size : 32 -- number from 32 to 128
property icon_options : {arrangement:arrangement_method, icon
size:icon_size}
end using terms from
-- WINDOW DIMENSIONS
property resize_indicator : true -- true/false
property window_width : 520
property window_height : 388
-- when the droplet is clicked
on run
try
tell application "Finder"
close (every window whose floating is true)
set this_folder to (the target of the front window) as alias
end tell
process_item(this_folder)
on error error_message number error_number
if the error_number is not -128 then
beep
display dialog error_message buttons {"Cancel"} default button 1
end if
end try
end run
-- This droplet processes folders dropped onto the applet
on open these_items
repeat with i from 1 to the count of these_items
set this_item to item i of these_items
set the item_info to info for this_item
if (alias of the item_info is false) and ,
(folder of the item_info is true) then
process_item(this_item)
end if
end repeat
end open
-- this sub-routine processes folders
on process_item(this_item)
-- NOTE that the variable this_item is a folder refernce in alias format
-- FOLDER PROCESSING STATEMENTS GOES HERE
tell application "Finder"
activate
try
set current view of container window of this_item to the
view_mode
if the view_mode is icon view then
set properties of the icon view options of container window
of this_item to the icon_options
else if the view_mode is list view then
set properties of the icon view options of container window
of this_item to the list_options
end if
if the resize_indicator is true then
copy the bounds of the container window of this_item to {h1,
v1, h2, v2}
set the bounds of the container window of this_item to {h1,
v1, h1 + window_width, v1 + window_height}
end if
on error error_message number error_number
if the error_number is not -128 then
beep
display dialog error_message buttons {"Cancel"} default
button 1
end if
end try
end tell
end process_item
Can someone help me alter this script to set the view variable to global?
Thanks so much. It is much appreciated.
All the best, in all things.
Darin Ames
email@hidden
www.crooner.com
>
> I am an entry level AppleScript user and need some help writing what
>
> should
>
> be a simple script for setting a window's view options in the Finder.
>
>
You might find just what you are looking for here.
>
>
http://www.apple.com/applescript/macosx/toolbar_scripts/
>
>
Corny
_______________________________________________
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.