Carlos,
Thanks for your reply. I guess I didn't make myself clear enough. I don't see how hardcoding an alias solves my problem.
I am already GUI scripting Safari. I have to open a URL and find links on that page. To do that, I'm saving the source of the page (via GUI scripting - command-option-U to view the source then command-S to save it). This creates a save dialog that I then use to name the file and select the location to save it. It just so happens that the location I want to save the file at is on the sidebar, so I can currently click it, via the command I showed earlier. These scripts have been working for me for a couple years now.
My dilemma is that I now need this script to work on two different operating systems (Tiger 10.4.11 and Snow Leopard 10.6.3) where the dialog, specifically as it relates to picking the folder from the sidebar, is not the same. Not only that, but "To_Be_Sent", while it exists as a folder on both machines, is NOT in the same location. If "To_Be_Sent" is a sidebar item on both machines, the scripting should be similar, even if the folder is located on completely differently named drives on the two machines.
If I hard-code the path, I'll have to maintain separate versions of the script on each machine. But even at that, I don't see how to tell the save dialog to use that definition to save the file.
Does this make sense?
Jim On May 11, 2010, at 1:56 PM, CYB wrote:
Forget about GUI scripting, there is a much better and reliable solution to do what you want: Independently that you have your folder into the sidebar, this is just an alias, but the folder reside in some place into your hard disk so why you just don’t make something like this set ToBesent to alias "MacPro:Users:username:Documents:MyFolder:" Of course you need to change this using the real location of your folder Carlos Ysunza B. Director Ysunza/Santiago Visual Communication • Automation Tel. (52)55 5256-0336 email@hidden http://www.ysunzasantiago.com http://www.thesecretmexico.com http://www.softrobot.com.mx
|