Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > AppleScript and the Finder

AppleScript and the Finder
Thread Tools
Junior Member
Join Date: Dec 2001
Location: My own personal purgatory
Status: Offline
Reply With Quote
Apr 18, 2002, 06:02 PM
 
I'm having trouble with an AppleScript called "Tandem" (from http://www.macosxhints.com/article.p...11127022706921 ) - specifically, it worked under OS X before, but since at least the 10.1.3 update, it hasn't.

My code, which is a slight variation of the original, but worked before the update:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier> set startup_disk to (path to startup disk)

tell application <font color = red>"Finder"</font>
activate

set this_window to make new Finder window
set the target of this_window to the startup_disk
set the bounds of this_window to {<font color = blue>0</font>, <font color = blue>46</font>, <font color = blue>1100</font>, <font color = blue>440</font>}
set the current view of this_window to column view

set this_window to make new Finder window
set the target of this_window to the startup_disk
set the bounds of this_window to {<font color = blue>0</font>, <font color = blue>468</font>, <font color = blue>1100</font>, <font color = blue>926</font>}
set the current view of this_window to column view

end tell </font>[/code]

What the code should do and used to do was open two Finder windows, each filling roughly the entire width and half the height of my screen, and each displaying the root level of my hard disk, Mjollnir.

Upon attempting to run this script now, a new window opens, then I get the error message 'Finder got an error: Can't set target of Finder window id ## to alias "Mjollnir:"'. The id number ## increments each time I try to run the script, but the rest of the message remains consistent.

If I comment out the "set the target..." line and try again, I get the error "Finder got an error: Can't set bounds of Finder window id ## to {0, 46, 1100, 440}".

Commenting out that line as well, I get the error "Finder got an error: Can't set current view of Finder window id ## to column view."

Any thoughts as to what's going on? I don't really know AppleScript, but it looks to me like the Finder "dictionary" still contains all of those terms, so why do they no longer work? Any help is appreciated.
"A scientist can discover a new star but he cannot make one. He would have to ask an engineer to do it for him."
     
   
Thread Tools
Forum Links
Forum 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 On
Top
Privacy Policy
All times are GMT -5. The time now is 09:49 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2