Hi Greg,

This is another approach, and not completely automatic, but how about creating an Automator workflow that checks for DTBs using the "Find Finder Items" action? You can specify where to check (e.g. /Volumes) and the Kind of file to check for and/or use the extension. Anything you would put in an AppleScript can also be accommodated with a "Run AppleScript" action. Distribute this with Olearira and have this accessible as a Finder action similar to your move Workflow. In the case of multiple discovered DTBs let the user select the one of interest.

Just some thoughts about alternatives.

Cheers,

Esther

On Nov 1, 2008, at 7:09 AM, Alex Jurgensen wrote:

Hi,

YOu could set everything up by running a pkg file.

Thanks for listening,
Alex,


On 1-Nov-08, at 8:59 AM, Greg Kearney wrote:

One of my goals has been to have the MacOS detect a CD or USB pen drive that has a digital talking book when mounted and then launch Olearia. Similar to the way that the MacOS detects Audio CDs or DVDs and launches the correct player.

I have worked up this solution but it seems like a hack to me. Is there a better way of doing this? Below are the steps I used.

1. I wrote an AppleScript (inclosed) that will look for either an ,opf file or a file named ncc.html

2. I created a symbolic link to /Volumes in my home directory

3. I activated folder actions on this link and attached the script in step one to it.

Now whenever /Volumes changes, that is a CD or pen drive is inserted, it will look for either a .opf (DAISY/NISO) or ncc.html (DAISY2.02) file and if there is one at the root directory will launch Olearia with that file.

The .opf files are preferred over ncc.html, that is to say if the disk has both on the root level the ,opf file will be opened.

I could automate some of the steps above but others require the user to interact with the Folder Action Setup application. As I said this whole process strikes me as a hack and there must be a better approved way of getting this done.

Greg Kearney

--APPLESCRIPT BELOW

(*
launch Olearia

This Folder Action handler is triggered whenever items are added to the attached folder in this case /Volumes. The script will attempt to find a file with the extention .opf or a file named ncc.html and will open such files in Olearia.

Greg Kearney November 2008

*)



on adding folder items to this_folder after receiving added_items
        
        
        try
                set unix_path to POSIX path of added_items
                set opf to do shell script "ls " & unix_path & "*.opf"
                
                say "Opening digital talking book"
                set opf_path to (POSIX file opf)
                
                tell application "Finder"
                        open opf_path
                        
                        tell application "Olearia"
                                activate
                        end tell
                end tell
        on error
                set ncc to do shell script "ls " & unix_path & "ncc.html"
                say "Opening digital talking book"
                set ncc_path to (POSIX file ncc)
                tell application "Olearia"
                        activate
                        open ncc_path
                end tell
        end try
        
        
end adding folder items to





Reply via email to