OCInkjet.com 728x90 banner, image is updated by season.

Apple-AppleScript-Script-Editor-Logo

Shop HP Download Store and get $5 OFF Orders Over $50! Use Promo Code SPEND150SAVE15

Basic AppleScript Dialog:

display dialog "Your text here" with icon stop buttons {"OK"} default button {"OK"} giving up after 5

'giving up after 5' will automatically close the script after the indicated interval of time has elapsed.

HTML Anchor Code

Here is a sample of how to write code to link one part of your blog page to another:

<a name = "By Email">[optional text]</a> --place this where you want the link to go <a href = "#By Email">By Email</a> --this is the actual link

more HTML

HTML Code to Link to Other Web Pages

Here is a sample of code to link to another page. this is similar to the anchor code, except that the destination code is the url of the destination site:

<a href= "www.webSite.
com"> Website Name</a>

--just replace "www.webSite.
com"
with the actual url destination site and replace 'Website Name' with the prompt that the user will see.
Apple-IIc-Apple-Screen

AppleScript Note:

It might be interesting to those of you who are AppleScript enthusiasts that the HyperCard (HyperTalk) project was the prototype back in the '80's of what became the system-wide Applescript language (akin to JavaScript) that is in use today.
Apple-Mac-512-Screen
3d-iMac-Large

Trapping for List Dialog Errors

With 'List Dialog' type dialogs, since errors cannot be intercepted in an 'on error' handler, there is no 'normal' way to trap for 'Cancel' which, of course, would result in some sort of undesirable error dialog such as 'User cancelled. Error number -128'. Here is an example of one simple way I have found to trap for this type of error: set x to (choose from list {"Joe","Amy",
"Bill"} with prompt "Choose a record:")
if x is false then
else
set targetItem to (x as text)
show every record whose cell "Name" contains x
end if
When the user clicks on 'Cancel', the variable x is assigned the boolean value false. So all you have to do is set up a conditional to deal with that and to perform the usual statements otherwise.

Learning AppleScript

Create Multiple Folders with Terminal

If you are more of a techy kind of person and are comfortable with using Terminal, here is a script you can use to easily create multiple folders:

First, for a single folder, type in: mkdir "Folder 1" --or whatever you want to name your folder, this creates a new directory, which, in effect is a new folder. To place multiple items in the 'Documents' folder: cd/Users/ Administrator/ Documents mkdir "Folder 1" "Folder 2" "Folder 3" To quickly create multiple folders, create a text file with the desired folder names (as many as you want) and name it something like 'folderList .txt'. Next type this in Terminal: cat folderList.txt |xargs mkdir Or you could create folders with the same prefix by entering: mkdir "Invoices " {"Corporate", "Individual", "Pro-Bono"}

Digg! Digg This!!

Mac LC III (1994), the first Mac that I ever owned, the CD-Rom and Zip drive were added much later.

Mac LC III (1994), the first Mac that I ever owned, the CD-Rom and Zip drive were added much later.

Basic HTML

Here is an example of a very simple HTML document:

<html>
<head>
<title>Basic HTML Document</title>
</head>
<body>
Your text goes here
</body>
</html>

more HTML

FileMaker Pro AppleScript to Backup Files

Apple IIc Speedway

This script was adapted from one written specifically for a FileMaker Pro program, although it could easily be used in any database program you use that supports AppleScript.

Most of what appears here builds upon the information presented in previous posts to this point. For a similar AppleScript that is tailored specifically for use with HyperTalk, see ‘HyperCard AppleScript Users’ in the right sidebar

tech fav 1

tell application "Finder"
try
set todaysDate to (current date)
set bkpYear to (year of todaysDate)
set monthlyBkp to ("Monthly Reports " & bkpYear) as text
if not (folder "Database Backups" exists) then
set targetFolder to (make new folder at folder "Desktop" of startup disk with properties {name:"Database Backups"})
end if
set replaceExecute to button returned of (display dialog "Are you sure you want to replace current backup contents with the selected items?" with icon caution buttons {"Cancel","OK"} default button {"OK"} giving up after 60)
–give user the chance to exit in case there is already a folder ‘Database Backups’ containing items that the user does not want to replace
if replaceExecute = "OK" then
select {file "Home Database" of folder "Database Programs)", ¬
file "Appointments" of folder "Database Programs", ¬
file monthlyBkp of folder "Database Programs", ¬
file "Accounts Receivable" of folder "Database Programs", ¬
file "Calendar" of folder "Database Programs"}
duplicate the selection to folder "Database Backups" replacing true
–If we proceed, ‘replacing true’ replaces the contents of the folder “Database Backups”
end if
on error
display dialog "Backup cancelled!" with icon stop buttons {"OK"} default button {"OK"} giving up after 3
end try
end tell
tell application "FileMaker Pro" to activate

As always, if you have any questions or comments, contact me at: hyperscripter@gmail.com or http://twitter.com/hyperscripter


160 comments to FileMaker Pro AppleScript to Backup Files

  • I simply want to mention I am just all new to blogging and honestly savored you’re web page. Almost certainly I’m planning to bookmark your blog . You surely come with very good articles. Many thanks for sharing your web-site.

  • Your web site is among the a form, i really enjoy the method that you manage the topics.

  • Hello, I need to say that FileMaker Pro AppleScript to Backup Files | Learning AppleScript for Beginners is a really great location to slack from function :) I genuinely enjoy your weblog and I have already bookmarked it. Please, maintain it up to date a lot more usually. Thank you!

  • Wonderful blog, partner! FileMaker Pro AppleScript to Backup Files | Learning AppleScript for Beginners is really one thing. We are starting mine quickly i will surely backup parts of the one you have, lawfully of course :)

  • Some of us even don’t realize the importance of this information. What a pity.

  • The best way to keep the records in every hospital is to have a backup copy of all the patients who had been confined. By doing so, you are helping the people for a quick recovery of the files in the future.

  • Hi, good post. I have been wondering about this issue,so thanks for posting.

  • This script is OK so long as the files aren't open. Backing up open database files will most likely corrupt the backups, rendering them useless. This would be potentially disastrous to the backup routine if the backups are being replaced as well. I would add a trap to the script to make sure the files aren't running prior to backing them up.

    In my own backup routines, I add a timestamp to the backup file names so you don't replace existing backups.

  • My fellow on Facebook shared this link and I’m not dissapointed at all that I came here.

  • [...]always a massive fan of linking to bloggers that I like but don?t get a whole lot of link like from[...]

  • I simply bookmarketed your blog and wanted to claim that I even have really enjoyed reading your wordpress blog posts. By any means I’ll be subscribing to your feed rss now, thanks

  • I need to express my love for your particular sympathy giving assist to firmly persons that want relief regarding that state of great interest. Your special total commitment upto acquiring the letter all-around was exceedingly vital and actually has in each and every issue enabled ladies like me to get to at their likes and dislikes. This new friendly and friendly guidance indicates a great deal to me and very much alternative to my mates. Best wishes; from a lot of people.

  • Noted your personal website out of your acquaintances Fb linkage, it seems that you have got establishing fanbase and i also now undertsand the reason why Extremely useful content, many merit 1.

  • I should convey my love for your specific kindness giving assist upto people that require treatment about that zone of interest. Your special dedication to actually having the meaning all-around was pretty priceless and also has in each and every situation triggered ladies like me to get to over at their likes and dislikes. This new inviting and friendly coaching indicates a good deal with me and substantially excess upto my partners. Best wishes; from each one of us.

  • The sense of intending to assist, however not determining how as well as place, is one area a number of us are going through.

  • It a new idea! Just wanna say thank you for the news you have got posted. Just continue publishing one of these post. I will be a loyal reader, thanks a lot.

  • Thanks, You haven’t supposed to achieve this, however I believe you encounter could express the mind-set that many of persons are really in.

  • We simply shared your blog and wished to feel that I have really enjoyed reading this blog posts. By any means I’ll be subscribing to your feed rss now, thanks

  • Sup, I do think your website could be having mozilla firefox browser prediction challenges. While i research your site in Trip, this indicates fine however when prospect in The web Traveler, it possesses a few overlapping. I just wished to provide you a short goes right up! Other in that case which often, splendid website!

  • My hope is the idea that some participants in our community will be fascinated by submitting their scholarly styling possible presentation with the conference.

Leave a Reply

  

  

  

HTML Guide from Peachpit Press

$1.99 Web Hosting at Go Daddy 120x240
Apple-Computer-Sticker-Old

iPhoto 6

Apple-ID-Badge
Create Multiple Folders with Terminal

If you are more of a techy kind of person and are comfortable with using Terminal, here is a script you can use to easily create multiple folders:

First, for a single folder, type in: mkdir "Folder 1" --or whatever you want to name your folder, this creates a new directory, which, in effect is a new folder. To place multiple items in the 'Documents' folder: cd/Users/ Administrator/ Documents mkdir "Folder 1" "Folder 2" "Folder 3" To quickly create multiple folders, create a text file with the desired folder names (as many as you want) and name it something like 'folderList.txt'. Next type this in Terminal: cat folderList.txt |xargs mkdir Or you could create folders with the same prefix by entering: mkdir "Invoices " {"Corporate", "Individual", "Pro-Bono"}

AppleScript 1-2-3

Stop by every day to shop our new Deal of the Day at BarnesandNoble.com!

Add http://www.scriptsforapple.com to Technorati Favorites

Apple-iMac-Rainbow

Digg! Digg This!!

An AppleScript to Verify a Date

Run this in the Script Editor:

set dateRecord to (current date)
set defaultDate to (date string of dateRecord)
try
set apptDate to text returned of (display dialog "Enter appointment date:" default answer defaultDate buttons {"Set"} default button {"Set"})
set datetext to apptDate as text
date apptDate --if an invalid date is entered, the next dialog is aborted and it triggers the error alert below.
display dialog datetext & " is a valid date." with icon note buttons {"OK"} default button {"OK"}
on error
set alertText to "An error has occurred!"
set messageText to quote & datetext & quote & " is an invalid date."
display alert alertText message messageText as warning buttons {"OK"} default button "OK" giving up after 15
return
end try