New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

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


Post Reply New Thread Subscribe

 
Thread Tools
mamekedi

 
Member Since: Aug 18, 2012
Posts: 2
mamekedi is on a distinguished road

mamekedi is offline
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
QUOTE Thanks
Mark FX

 
Mark FX's Avatar
 
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 168
Mark FX has a spectacular aura about

Mark FX is offline
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
QUOTE Thanks
mamekedi

 
Member Since: Aug 18, 2012
Posts: 2
mamekedi is on a distinguished road

mamekedi is offline
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
QUOTE Thanks
Mark FX

 
Mark FX's Avatar
 
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 168
Mark FX has a spectacular aura about

Mark FX is offline
Looks Good, Well Done.

Mark
QUOTE Thanks

Post Reply New Thread Subscribe


« Python Development on OS X Mountain Lion | random image on each song in itunes »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Question about pointing documents, videos, folders to server folder markw10 OS X - Operating System 1 09-11-2006 12:03 PM
How to open Finder files in the same window? sgmiller Switcher Hangout 3 06-06-2006 09:55 PM
HP PhotoSmart 2575 Driver hana2004 OS X - Operating System 2 05-03-2006 06:03 PM
finder/pref window,can anyone tell me what this does? iNAP Schweb's Lounge 3 08-31-2005 02:13 PM
Copying one folder over another of the same name destroys data! Cloudane Switcher Hangout 28 05-18-2005 07:10 PM

All times are GMT -4. The time now is 12:50 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?