Open 1e finder with folder downloads , Open 2e finder window with Documents folder

Joined
Aug 18, 2012
Messages
2
Reaction score
0
Points
1
hello You all,

i have a applescript script to open 2 finder windows below.
The problem is that i want to open the 1e finder window with the Downloads folder and the 2e finder window with the documents folder.

Can somebody help me, see script below


-- Feel free to copy, modify and redistribute this script any way you like
-- Be careful to run this "AS IS" script on your machine. I've
-- tested it and it works on my iMac but if you don't know what you're doing,
-- you could end up hurting your beloved Mac and the data on it.
-- Cheers, Loek

-- This script opens two finder windows side-by-side
property finderWidth : 900 -- MUST BE SMALLER THEN HALF OF THE ACTUAL SCREEN SIZE!
property finderHeight : 700

tell application "Finder"
set screenBounds to bounds of window of desktop
set screenWidth to item 3 of screenBounds
set screenHeight to item 4 of screenBounds
set centerX to screenWidth / 2
set centerY to screenHeight / 2
activate
set visible of (every process whose visible is true and frontmost is false) to false
set finder1 to make new Finder window
set the bounds of finder1 to {centerX - finderWidth div 1, centerY - (finderHeight / 2) div 1, centerX - 2 div 1, centerY + (finderHeight / 2) div 1}
set the current view of finder1 to column view
set finder2 to make new Finder window
set the bounds of finder2 to {centerX + 2, centerY - (finderHeight / 2) div 1, centerX + finderWidth, centerY + (finderHeight / 2) div 1}
set the current view of finder2 to column view
end tell
 
Joined
Aug 13, 2011
Messages
200
Reaction score
7
Points
18
Location
West Sussex
To select a particular folder, use something like this.

Code:
tell application "Finder"
	activate
	set finder1 to open (path to downloads folder)    -- line 1
	set finder2 to open (path to documents folder)    -- line 2
end tell

I hav'nt inlcuded any window size or postion code as you have done, so just past the two labeled lines into the bottom of your script, before the end tell.

Regards Mark
 
OP
M
Joined
Aug 18, 2012
Messages
2
Reaction score
0
Points
1
Thank you for your support

Here my final script:


property finderWidth : 1000 -- MUST BE SMALLER THEN HALF OF THE ACTUAL SCREEN SIZE!
property finderHeight : 1000

tell application "Finder"
close every window
set screenBounds to bounds of window of desktop
set screenWidth to item 3 of screenBounds
set screenHeight to item 4 of screenBounds
set centerX to screenWidth / 2
set centerY to screenHeight / 2
activate
set visible of (every process whose visible is true and frontmost is false) to false
set finder1 to make new Finder window
set the target of finder1 to path to downloads folder
set the bounds of finder1 to {centerX - finderWidth div 1, centerY - (finderHeight / 2) div 1, centerX - 15 div 1, centerY + (finderHeight / 2) div 1}
set the current view of finder1 to list view
set finder2 to make new Finder window
set the target of finder2 to disk "MyData"
set the bounds of finder2 to {centerX + 15, centerY - (finderHeight / 2) div 1, centerX + finderWidth, centerY + (finderHeight / 2) div 1}
set the current view of finder2 to list view
end tell
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top