|
|
Download File, Open Window?
|
|
|
|
Fresh-Faced Recruit
Join Date: Dec 2002
Location: Oxford
Status:
Offline
|
|
I've got to learn more Applescript!
Specifically, I'm trying to set up a "folder action" so that when I download a file from within Safari, my "downloads" folder automatically opens and comes to the front.
I don't want to automatically run/open files and programs (Safari gives you that option), but I'd like to save myself a click.
Does anyone have any ideas about solutions to this problem, or maybe some good websites with Applescript snippets or tutorials?
Thanks,
Jacob
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 1999
Location: Always within bluetooth range
Status:
Offline
|
|
on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
activate
set the target_folder to folder "Desktop" of home
open folder "Desktop" of home
end tell
end try
end adding folder items to
This would work if your Safari downloads folder is your user desktop folder. You'll have to change the target folder name depending on where you actually have your folder.
If you're downloads directory is not in your home folder... obvoulsy you would not be able to use the "home" command that I've used in this script.
Also, this is just the mechanics of how to open the folder. If you attach it to your downloads folder, it will open a finder window ANYTIME you add an item (not just when Safari adds an item). If you have AppleScript studio installed (assuming 'yes' here) Check out Library/Scripts/Naviagation Scripts for good examples (Library being the main library folder, not the one in your user folder).
If you're still stuck .. give me more details of your variables and I may be able to craft one that will specifically suit your needs.
good luck
(
Last edited by Krusty; Apr 26, 2003 at 07:00 PM.
)
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 1999
Location: Always within bluetooth range
Status:
Offline
|
|
actually, I just found that the "reveal" command works just as well.
on adding folder items to this_folder after receiving added_items
try
tell application "Finder"
activate
reveal added_items
end tell
end try
end adding folder items to
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Dec 2002
Location: Oxford
Status:
Offline
|
|
Thanks, Krusty.
I just tried your second Applescript, and it works great. (Safari takes over and pushes the Finder window to the back, but I can cope with that.)
Any tips on which sites or books I should checkout to learn Applescript?
Thanks again,
Jacob
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 1999
Location: Always within bluetooth range
Status:
Offline
|
|
Originally posted by immsav:
Any tips on which sites or books I should checkout to learn Applescript?
Not really. I'm not any sort of "hard core" applescripter and I've never used a book ... only write them on rare occasion and usually I just try to find a sample script that has elements of what I need and ... well, just sorta wing it. Someone else may have better advice.
p.s. noticed that problem with the window opening and then returning to the back ... I can't remember the command but I KNOW you can do something to force it back to the front.
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Dec 2002
Location: Oxford
Status:
Offline
|
|
Thanks again, Krusty. Does anyone else know how to force a window to front?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|