little finder window issues

#search-window

i want another method to access the search-mode. Actually i do:

	tell application "Finder"
			activate
			reveal startup disk
			delay 0.3
			tell application "System Events"
				tell process "Finder" to keystroke "f" using (command down)
			end tell
		end tell

the recorded script here doesn’t work.

tell application "Finder"
	activate
	make new Finder window
	set target of Finder window 1 to startup disk #computer container
	set target of Finder window 1 to alias file ""
end tell

#flow window

here, i want bigger flow chart previews (images, as example). My script works (images get bigger) as long as the flow chart pull-slider is set on a lower level (list view smaller, flow list bigger). Annoying, because it seems more a bug than a feature. (Lion 4)

tell application "Finder"
	
	set win1 to window 1
	tell win1
		activate
		set current view to icon view
		clean up by modification date
	end tell
	
	tell icon view options of win1 to set icon size to 300
	tell win1 to set current view to flow view
end tell

Hi. Refer to an alias file by its index or its name, which can’t be “”.

the paragraph before stated:
the recorded script here doesn’t work.

hello

Assuming that “path:to:a:file” points to an existing file and that “path:to:a:folder” points to an existing folder
alias “path:to:a:file” is OK
alias “path:to:a:folder” is OK
file “path:to:a:file” is OK
file “path:to:a:folder” is wrong
folder “path:to:a:folder” is OK
alias file “path:to:a:folder” is wrong
alias folder “path:to:a:folder” is wrong
alias file “path:to:a:file” is wrong
alias folder “path:to:a:file” is wrong

Assuming that “path:to:a:file” points to a non existing file and that “path:to:a:folder” points to a non existing folder
alias “path:to:a:file” is wrong
alias “path:to:a:folder” is wrong
file “path:to:a:file” is OK
folder “path:to:a:folder” is OK
which means that we may use the two late descriptors to create the objects.

As far as I know, “” is not a valid pathname so
alias file “”
is wrong twice.
Worse,
set target of Finder window 1 to alias file “”
is wrong three times because, always as far as I know, the Finder has no window for a file, just for a folder.

From my point of view this one is really dangerous.

After running it, when I tried to reset the icon view, I got an awful pile of icon refusing to align as I asked them to do.

I was forced to use this script :

tell application "Finder"
	tell window 1
		activate
		set current view to icon view
		tell its icon view options to set icon size to 60
		set current view to flow view
		delay 0.1
		set current view to icon view
		tell its icon view options
			set arrangement to not arranged
			delay 0.1
			set arrangement to snap to grid
		end tell
	end tell
end tell

It gave a decent size to the icons so that they no longer stay glued as they were after running your script.

Yvan KOENIG (VALLAURIS, France) mercredi 26 mars 2014 14:53:50

Hi Yvan,
i’sorry if you ran in problems with the flow chart view script.
In fact, i posted the script, because it didnt work. My goal was to enlarge the flow chart previews. Because this isnt sciptable, i thought to do the trick by scaling icon views first. I have tons of images (myself and from others) to manage, therefore my need for such a script. Arranging is better than cleaning, thats sure.

and my first script was an attempt to rebuild spotlight’s search-window. In fact, a smart folder has no target and is foremost an empty file.

I found a better shortcut now.

 tell application "Finder"
           activate
            tell application "System Events" to tell process "Finder" to keystroke space using (command down, option down)
        end tell