I’m novice in AppleScript language. I’m trying to buil a script which create a dialog list with all volumes mounted. After that, the user could choose a volume in the list and the script will get the path of selected volumes and stock it in a variable.
My code is:
set volName to do shell script "ls /volumes/"
return volName
It’s work but after that. I don’t know what I have to do.
But it remains a problem.
I use this script in an automator workflow, so I want to get selected volume name to get it’s contain, filter it, copy, etc… many automator actions. But when I put the script in an automator action, it don’t pass variable to others actions.
Per example here is my actions :
script to get selected volume name
get folder contain
filter finder items
copy finder items
I take care to add the line after you script
return "/Volumes/" & result
But Automator appears to bypass this return.
All my actions are well linked by “Use results of the previous action”
This should be possible without scripting in Automator. Drag the following actions in from the Finder library
Get Specified Finder Items
Eject Disk
Mount all Disks you want to eject and choose them in the Get… action. Even if all disks aren’t present when you run the workflow, Automator will eject those that are.
Thanks Kevin, but i don’t want to eject volume.
I want user select a volume (Compact Flash card or other Digital photos card), get photos, filter, copy, etc…
So i don’t know volume name. Just the script user who will insert a card, will be abble to select it. But to simplifize things, i want just a volume list and not a big files list with all rep and files of system !!
Thanks
Xavier
Browser: Firefox 1.0.7
Operating System: Mac OS X (10.4)
Simpler still. If the the disk is mounted, you can use a Get Specified Finder items and check the Show Action When Run option. The user click the plus button and chooses the volume. When they click continue, only the volume name should be passed to the next action. Does that do it?
Sure i understand but I want it more simple for user.
In your case, user have to click “plus” button and select volume in a complex list with files, repertories, volumes, etc…
I want a simple list of volumes and that’s it. Not a complicated thing.
Bruce found me a easy way to get a volume list but i can’t passed selected volume name through next action.
I see 2 solutions :
I find the way to pass selected volume name
I make a select list like the “Get Specified Finder items” action