On Nov 30, 2007, at 9:45 AM, Claude wrote:

I want to export in one file all my passwords : actually when I try to export them I have one text file for each password !

Is there a solution, an Apple script ?...

I wrote the following to do the same thing with serial numbers. You should be able to modify it to do passwords. This isn't the most efficient way to do it, given that I wrote it with the Applescript knowledge I had at the time. I'd do it differnetly if I wrote it again. :) Hope that helps!

(*= ========================================================================
-- Yojimbo Serials to Tab-Delimited
--
-- Takes a folder of serial number files exported from Yojimbo and converts them to a tab-delimited file. The first line in the
-- tab delimited file contains the field names.
--
-- How to Use: -- 1) Export your serial number records from Yojimbo to a folder.
--
-- 2) Drag that folder on to the Yojimbo Serials to Tab- Delimited Script
--
--  2006.03.20 - Version 1
--
--   Author: Kenneth Kirksey
--   Email: [EMAIL PROTECTED]
--
= = = ======================================================================*)

on open theFolder
        
        tell application "Finder"
                set serialsFiles to document files of (item 1 of theFolder)
                
                set numberOfFiles to number of items in serialsFiles
                set iteration to 1
                
                
----------------------------------------------------------------------------------------------------------------------------------------
-- Prompt the user for where they want to save the resulting bookmarks file. Write the field names to the first
                --  record in the file.
                
----------------------------------------------------------------------------------------------------------------------------------------
set outFileLocation to choose file name with prompt "Save serials file as" default name "serials.txt"
                
                set outFile to open for access outFileLocation with write 
permission
                
write ("Product Name" & tab & "Owner Name" & tab & "Email Address" & tab & "Organization" & tab & "Serial Number" & return) to outFile
                
                
----------------------------------------------------------------------------------------------------------------------------------------
                -- Step through each file to extract:
                --    Product Name
                --    Owner Name
                --    Email Address
                --    Organization
                --    Serial Number
                
----------------------------------------------------------------------------------------------------------------------------------------
                repeat with theFile in serialsFiles
                        
                        if iteration mod 5 = 0 then
display dialog "Processing " & iteration & " of " & numberOfFiles & " records." buttons {"Cancel"} giving up after 1
                        end if
                        
                        set inFile to (open for access (theFile as alias))
                        
                        
-----------------------------------------------------------------------------------------------------------------------------------
-- Each line is delimted with a linefeed (Unix style). Read in a line, trim off the trailing linefeed, and trim off
                        -- the field label at the beginning of the line.
                        
-----------------------------------------------------------------------------------------------------------------------------------
                        set theProductName to (read inFile until ASCII 
character 10)
set theProductName to (text items 15 through -2 of theProductName) as string
                        if theProductName contains (ASCII character 10) then
                                set theProductName to ""
                        end if
                        
                        set theOwnerName to (read inFile until ASCII character 
10)
set theOwnerName to (text items 13 through -2 of theOwnerName) as string
                        if theOwnerName contains (ASCII character 10) then
                                set theOwnerName to ""
                        end if
                        
                        set theEmailAddress to (read inFile until ASCII 
character 10)
set theEmailAddress to (text items 16 through -2 of theEmailAddress) as string
                        if theEmailAddress contains (ASCII character 10) then
                                set theEmailAddress to ""
                        end if
                        
                        set theOrganization to (read inFile until ASCII 
character 10)
set theOrganization to (text items 15 through -2 of theOrganization) as string
                        if theOrganization contains (ASCII character 10) then
                                set theOrganization to ""
                        end if
                        
                        set theSerialNumber to (read inFile until ASCII 
character 10)
set theSerialNumber to (text items 16 through -2 of theSerialNumber) as string
                        if theSerialNumber contains (ASCII character 10) then
                                set theSerialNumber to ""
                        end if
                        
                        
-----------------------------------------------------------------------------------------------------------------------------------
                        -- Write the serials to the text file.
                        
-----------------------------------------------------------------------------------------------------------------------------------
write (theProductName & tab & theOwnerName & tab & theEmailAddress & tab & theOrganization & tab & theSerialNumber & return) to outFile
                        
                        close access inFile
                        
                        set iteration to iteration + 1
                        
                end repeat
                
                close access outFile
                
                display dialog "Done!" buttons {"OK"}
                
                
        end tell
        
end open

--
------------------------------------------------------------------
This message is sent to you because you are subscribed to
 the mailing list <yojimbo-talk@barebones.com>.
To unsubscribe, send mail to: <[EMAIL PROTECTED]>
List archives:  <http://www.listsearch.com/yojimbotalk.lasso>
Have a feature request, or not sure if the software's working correctly? Please send mail to: <[EMAIL PROTECTED]>

Reply via email to