• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: add name/date to picture
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: add name/date to picture


  • Subject: Re: add name/date to picture
  • From: Jeff Shapiro <email@hidden>
  • Date: Thu, 10 Mar 2005 01:48:16 -0700
  • Organization: Nensha

Robert Poland was seen on 3/9/05 6:14 PM talking about:
> GraphicConverter 5.5.2, OS 10.3.8
>
> With an Applescript I would like to be able to add the name and
> current date (one line) to the margin of a picture.

You got me wondering so I tried quickly throw something together.

Here it is:
(Watch out for line wraps.)

This script prompts for a folder and adds a top margin then centers the
file name and current date in the new margin. There may be a bug in GC
because the "color" of draw textline doesn't seem to have any effect.
(It's always black.)

(I know this is probably a mess to the more experience scripters around
here; however, I'm new to AS and I really didn't want to spend a lot of
time on this :-)

-- Set up date variables
set cyear to year of (current date)
set cday to day of (current date)
set cmonth to month of (current date) as integer
set cDate to cyear & "." & cmonth & "." & cday

tell application "Finder"
	--activate
	set pathName to (choose folder with prompt "Choose  Folder")
	set fileList to every file of folder pathName whose name contains
".jpg"
	set loopFinish to count of items of fileList
end tell

tell application "GraphicConverter"
	repeat with i from 1 to loopFinish
		set currentFile to item i of fileList
		open currentFile as alias
		set fname to name of window 1
		set nameDate to fname & "    " & cDate as string
		tell window 1
			set {picWidth, picHeight} to image dimension
			set picCenter to picWidth / 2 as integer
			change margins with {0, 28, 0, 0}
			draw textline into text nameDate justification 2 color {0, 0, 0}
point {picCenter, 20} font "Arial" size 18 with antialias
		end tell
		save window 1 with wwwready
		close window 1
	end repeat
	quit yes
end tell
----


--
Listserv only address.
Jeff Shapiro
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: add name/date to picture
      • From: Kevin Meaney <email@hidden>
References: 
 >add name/date to picture (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Data arithmetic
  • Next by Date: Re: What are the limitations of the AppleScript data structure and tools?
  • Previous by thread: add name/date to picture
  • Next by thread: Re: add name/date to picture
  • Index(es):
    • Date
    • Thread