Script to open specific folders

The following script opens two windows and places them just where I want them.

What must I add so that the first window selects the Applications folder and the second folder selects a subfolder called “myDesktop” in my “Documents” folder?

tell application “Finder”
set this_window to make new Finder window
set the bounds of this_window to {14, 92, 551, 386}
set the current view of this_window to column view
set this_window to make new Finder window
set the bounds of this_window to {14, 461, 551, 755}
end tell

Also, can the present script be simplified?

Thank you.

I’ve been able to modify the first half of the script by looking over other scripts in this forum.

The second part reflects a new attempt, but does not work.

tell application “Finder”
–top window
open folder “Applications”
set bounds of window “Applications” to {14, 92, 551, 386}
set the current view of window “Applications” to column view
–bottom window
open folder “myDesktop” of folder “Documents” of home
set bounds of window “myDesktop” of folder “Documents” of home to {14, 461, 551, 755}
end tell

I was able to shorten the script to this:

tell application "Finder"
	tell (open container window of (path to applications folder)) to ¬
		set {bounds, current view} to {{14, 92, 551, 386}, column view}
	tell (open container window of (path to documents folder)) to ¬
		set {bounds, current view} to {{14, 461, 551, 755}, column view}
end tell

The Finder dictionary suggests that you can specify properties in the open command, but in my tests that does not work (10.3.5).

Cheers
-Mark

Hi,

‘reveal’ does this:

set apps_folder to (path to “apps” from local domain)
set user_docs_folder to (path to “docs” from user domain)
tell application “Finder”
activate
– select Applications folder
reveal apps_folder
delay 1
– select myDocs folder
reveal folder “myDocs” of user_docs_folder
end tell

gl,

To answer the original question, you can use the “target” property to set the folder to which the window is currently viewing:

Jon


[This script was automatically tagged for color coded syntax by Convert Script to Markup Code]