> This is an old script. Somehow, it has not found a place in the
> "Pages" section. So I am posting it along with description. I hope it
> works in Snow Leopard.
I'd love to have this, but it doesn't seem to work. It brings up the
dialogue to enter the path, but never enters it or hits "Go". I tried
increasing the delay, but that doesn't seem to be it. Probably
something with the "panel" code, but I don't know enough to fix that.
--
Rob McBroom
<http://www.skurfer.com/>
> Which OS are you using? Which application did you try to use the
> script in?
> It works fine in Leopard.
Sorry. I assume everyone's using the newest stuff all the time. I'm on
10.6.1. I tried it in TextMate and the AppleScript Editor itself.
Seems to be the same result in both Open and Save dialogues.
I'm using Quicksilver β56a7 (3825). I copied and modified the script
to just display the path to make sure it was coming in from QS and it
is there.
More of an FYI. I wasn't suggesting anyone needs to spend time on it
now.
on open theFile
set filePath to POSIX path of theFile
tell application "System Events"
set theApplication to application processes whose frontmost is true
set target to item 1 of theApplication
set target to a reference to front window of target
tell target to keystroke "g" using {command down, shift down} --
Activate goto field
delay 0.1
try
set value of text field 1 to filePath
delay 0.1
click button "Go"
on error theError -- Carbon apps don't support setting the field
directly, so type out the path.
keystroke filePath
delay 1
keystroke return
end try
end tell
end open
> Rob, can you please give me step by step instructions on how to
> reproduce the bug he encountered?
No surprises I don't think.
* I place the script in ~/Library/Application Support/Quicksilver/
Actions
* Open TextEdit (a new document comes up by default)
* hit ⌘S to Save
* invoke Quicksilver
* navigate to a folder
* ⇥ to the next pane
* choose the open_save action
* hit ↩
All I ever get is the "Go to the folder" prompt, empty. I'll attach a
screenshot, but I don't know how well Google Groups handles that.
open textedit
press Cmd+S to save
press Cmd+Shift+G
now, open script editor and paste this script
tell application "System Events"
tell process "TextEdit"
tell window 1
tell sheet 1
get UI elements
end tell
end tell
end tell
end tell
I want to see the result of this applescript.
> I want to see the result of this applescript.
>
I got an error because access for assistive devices wasn't enabled.
After enabling it, I got the result below. You probably won't be
surprised to know that the open_save script also works unmodified now.
So, that was the problem. I usually run with that enabled anyway, just
forgot to re-enable it after installing Snow Leopard.
My modified version also seems to work still. I wonder if a version
that works in both cases is preferable, but maybe it doesn't work on
Leopard?
Result:
{group 1 of sheet 1 of window "Untitled" of application process
"TextEdit" of application "System Events", button "Save" of sheet 1 of
window "Untitled" of application process "TextEdit" of application
"System Events", button "Cancel" of sheet 1 of window "Untitled" of
application process "TextEdit" of application "System Events",
checkbox 1 of sheet 1 of window "Untitled" of application process
"TextEdit" of application "System Events", text field 1 of sheet 1 of
window "Untitled" of application process "TextEdit" of application
"System Events", static text "Save As:" of sheet 1 of window
"Untitled" of application process "TextEdit" of application "System
Events", static text "Where:" of sheet 1 of window "Untitled" of
application process "TextEdit" of application "System Events", pop up
button 1 of sheet 1 of window "Untitled" of application process
"TextEdit" of application "System Events", sheet 1 of sheet 1 of
window "Untitled" of application process "TextEdit" of application
"System Events"}
using terms from application "Quicksilver" on get direct types return {"NSFilenamesPboardType"} end get direct types on open theFile set filePath to POSIX path of theFile tell application "System Events" set theApplication to application processes whose frontmost is true set target to item 1 of theApplication set target to a reference to front window of target tell target to keystroke "g" using {command down, shift down} -- Activate goto field delay 0.1 if ((count target's sheets) > 0) then set target to front sheet of target -- Open panels use a sheet tell target tell sheet 1 try set value of text field 1 to filePath delay 0.5 click button "Go" on error theError -- Carbon apps don't support setting the field directly, so type out the path. keystroke filePath delay 1 keystroke return end try end tell -- end tell end tell end openend using terms from on open files theFiles set filePath to POSIX path of item 1 of theFiles--
You received this message because you are subscribed to the Google Groups "Quicksilver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blacktree-quicks...@googlegroups.com.
To post to this group, send email to blacktree-...@googlegroups.com.
Visit this group at http://groups.google.com/group/blacktree-quicksilver?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to a topic in the Google Groups "Quicksilver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/blacktree-quicksilver/NwYiLiPt3NQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to blacktree-quicks...@googlegroups.com.
Hi,
I'm a little late to this party, but maybe I have something that can help.
If you're using Default Folder X (which I highly recommend) this super simple AppleScript should do the trick:on open theFolder
tell application "Default Folder X Helper"
if IsDialogOpen then
SwitchToFolder theFolder
end if
end tell
end open
I've been using this for years and still works perfectly with QS 1.0.0 (4000):
- Open/Save Dialog Box
- Call up QS
- Find your destination folder
- Tab
- Call up this Script
- Enter
I don't remember exactly where I got it from, but I think parts of it are straight from the DF Dev.
a.
You received this message because you are subscribed to a topic in the Google Groups "Quicksilver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/blacktree-quicksilver/NwYiLiPt3NQ/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to blacktree-quicks...@googlegroups.com.