I am trying to write a script to format your bibliography and copy it to the clipboard, which requires me to underline the title of the book, which I don’t know how to do.
I would also like to set an option to send me an email for expansion in two different places. not like a spammer, just open a message adressed to me, like a mailto: link in a web browser.
Finally, I would like to add a message to loop the script and process another set of data (without preserving the variable settings, obviously).
Here is my script, such as it is.
--This script will format your bibliography for you.
--
--This section asks you what format you want
set BibliographyFormat to (choose from list {"MLA", "APA", "Request..."} with prompt "What format will your Bibliography be?") as string
if BibliographyFormat is "MLA" then
--This section asks what your source format is.
set sourceFormat to (choose from list {"Single Author Book", "Multiple Author (up to 5) Book", "Book By Editor", "Newspaper", "Print Magazine", "Online Magazine", "Interview", "Website", "Request..."} with prompt "What format is your source?") as string
if sourceFormat is "Single Author Book" then
--This section asks for your information for a single author book
--This asks the author name
set authorName to (display dialog "Author Name" default answer "Last, First" buttons {"Next"} default button 1)
if button returned of authorName is "Next" then
set author to text returned in authorName
end if
--This asks the book's title.
set bookTitle to (display dialog "Book Title" default answer "Title" buttons {"Next"} default button 1)
if button returned of bookTitle is "Next" then
set title to text returned in bookTitle
end if
--This asks the edition and sets the script to leave it out of the result if you don't input anything.
set bookEdition to (display dialog "Book Edition- Leave Blank for First Edition" & return & "Ex: \"First\", not \"One\" or \"1\"" default answer "" buttons {"Next"} default button 1)
if button returned of bookEdition is "Next" then
set edition to text returned in bookEdition
if text returned in bookEdition is "" then
set editionYes to ""
else
set editionYes to " Edition. "
end if
end if
--This asks the publishing city
set publishCity to (display dialog "Publishing City" default answer "City" buttons {"Next"} default button 1)
if button returned of publishCity is "Next" then
set pCity to text returned in publishCity
end if
--This asks the publishing company
set publishCompany to (display dialog "Publishing Company" default answer "Company" buttons {"Next"} default button 1)
if button returned of publishCompany is "Next" then
set pCompany to text returned in publishCompany
end if
--This asks the publishing date
set publishDate to (display dialog "Publishing Date" default answer "Year" buttons {"Next"} default button 1)
if button returned of publishDate is "Next" then
set pDate to text returned in publishDate
end if
--This section formats the information propely and copies it to the clipbooard
--
--
--The Title variable is what I want underlined.
set the clipboard to author & ". " & title & ". " & edition & editionYes & pCity & ": " & pCompany & ". " & pDate & "."
--
--
--This is as far as I got.
else if sourceFormat is "Multiple Author (up to 5) Book" then
-- item 2 action goes here
else if sourceFormat is "Book By Editor" then
-- item 3 action goes here
else if sourceFormat is "Newspaper" then
-- item 4 action goes here
else if sourceFormat is "Print Magazine" then
-- item 5 action goes here
else if sourceFormat is "Online Magazine" then
-- item 6 action goes here
else if sourceFormat is "Interview" then
-- item 7 action goes here
else if sourceFormat is "Website" then
-- item 8 action goes here
else if sourceFormat is "Request..." then
--
--
--This is the first part I want to open an email
--
--email "williewideweb@gmail.com" subject "More Bibliography Formats" body "This is the extra source format I want:"
end if
else if BibliographyFormat is "APA" then
-- item 2 action goes here
else if the button returned of the result is "Request..." then
--
--
--This is the second part I want to open an email
--
--email "williewideweb@gmail.com" subject "More Bibliography Formats" body "This is the extra bibliography format I want:"
end if
--
--
--This part will ask you if you want to make another bibliography.
--
set startOver to (display dialog "Format another bibliography?" & return & return & "For another bibliography format, you need to rerun the script" buttons {"Yes, Same Source Format", "Yes, Different Source Format", "No, I'm Done"} default button 1)
if button returned of startOver is "Yes, Same Source Format" then
--
--
--This is where I want it to loop to the first input box - these should help with that:
if sourceFormat is "Single Author Book" then
--return to Single Author Book
else if sourceFormat is "Multiple Author (up to 5) Book" then
--return to Multiple Author (up to 5) Book
else if sourceFormat is "Book By Editor" then
--return to Book By Editor
else if sourceFormat is "Newspaper" then
--return to Newspaper
else if sourceFormat is "Print Magazine" then
--return to Print Magazine
else if sourceFormat is "Online Magazine" then
--return to Online Magazine
else if sourceFormat is "Interview" then
--return to Interview
else if sourceFormat is "Website" then
--return to Website
end if
else if button returned is "Yes, Different Source Format" then
--return to "What format is your source?" list
else if button returned is "No, I'm Done" then
stop
end iff
It is extremely long, and will only get longer.
Thanks in advance- if you solve my problem i’ll let you have it for free (along with everybody else that wants it!)
Model: iMac G5 with iSight (Early 2006)
AppleScript: This is the Script Editor version, if that’s what Applescript version means: Version 2.1.1 (81). If it means what version my applescript is, then consider it 0.3
Browser: Safari 525.13
Operating System: Mac OS X (10.5)