Send Applescript-users mailing list submissions to
email@hidden
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.apple.com/mailman/listinfo/applescript-users
or, via email, send a message with subject or body 'help' to
email@hidden
You can reach the person managing the list at
email@hidden
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Applescript-users digest..."
Today's Topics:
1. Re: Nice Automator article on O'Reilly (David Marshall)
2. Startup script not working (Gunno Ivansson)
3. Re: slow folder action script (Yvan KOENIG)
4. Re: Script Editor in Tiger: where's the Find gone? (Martin Orpen)
5. Re: Script Editor in Tiger: where's the Find gone?
(Le Stang Jean-Baptiste)
6. Re: Script Editor in Tiger: where's the Find gone? (Martin Orpen)
7. Re: Startup script not working (Andrew Oliver)
8. Re: [ann] TextCommands 0.1.0 (Rob Stott)
9. SV: Startup script not working (Gunno Ivansson)
10. Re: [ann] TextCommands 0.1.0 (Emmanuel)
11. RE: email-addresses are 1big email-address (Jan-Bultereys)
12. Re: [ann] TextCommands 0.1.0 (email@hidden)
13. AppleScript Doesn't Suck [was - Re: Nice Automator article on
O'Reilly] (Mr Tea)
14. Re: [ann] TextCommands 0.1.0 (Rob Stott)
15. Re: Nice Automator article on O'Reilly (Dennis W. Manasco)
16. Re: Nice Automator article on O'Reilly (John C. Welch)
17. Re: Nice Automator article on O'Reilly (Mark Smith)
18. keyboard mapping (Hudson Barton)
----------------------------------------------------------------------
Message: 1
Date: Mon, 9 May 2005 01:32:37 -0400
From: David Marshall <email@hidden>
Subject: Re: Nice Automator article on O'Reilly
To: AppleScript <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
property agreement_with_Elliotte : {"AppleScript is bad for everyone"}
global dudgeon, compromise
set up_straw_men to knock("down")
check_the_score()
on knock(heads_together)
set the_body_politic to {"AppleScript is bad for everyone", ¬
"It all depends on who you are and what you're trying to do"}
if the rest of the_body_politic is not in agreement_with_Elliotte ¬
then set dudgeon to "up"
put heads_together to compromise --[1]
end knock
on check_the_score()
display dialog "Current Score: " & dudgeon & ", " & compromise
end check_the_score
--[1] Yeah, I know the compiler changes "put" to "copy" :-)
- - - - -
Dave
------------------------------
Message: 2
Date: Mon, 09 May 2005 08:34:35 +0200
From: Gunno Ivansson <email@hidden>
Subject: Startup script not working
To: <email@hidden>
Message-ID: <BEA4D11B.177D%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
I am trying to save boottime to a file at start up, but it's not
working.
Here is my script, it is saved as an application and added to my
account's
start up items.
property gCurrentDate : (current date)
property myFilePath : (path to documents folder from user domain as
text) &
"Flex:BootTime" & ((day of gCurrentDate) as string) & ((month of
gCurrentDate) as string)'s text 1 thru 3 & ((year of gCurrentDate) as
string) & ".txt"
on run
try
alias myFilePath
on error
set myPosixPath to POSIX path of myFilePath
do shell script "/usr/sbin/sysctl kern.boottime > " &
myPosixPath
end try
end run
Other start up scripts that works just fine, for example one that mount
network shares, but this one won't run on start up.
The strange thing is that it runs if I do a restart.
What am I doing wrong? Perhaps there is a better way (I am sure there
is) to
store boottime?
Gunno Ivansson
------------------------------
Message: 3
Date: Mon, 9 May 2005 08:35:32 +0200
From: Yvan KOENIG <email@hidden>
Subject: Re: slow folder action script
To: "AppleScript User's List" <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=WINDOWS-1252; format=flowed
Le 9 mai 2005 , à 1:56, kai a écrit :
Moving hundreds of files will inevitably take some time, Yvan -
although you can speed up the process by moving them in batches,
rather than individually. Try something like this (sorry about the
mishmash of languages):
-------------------
property monDossier : "Mes dossiers"
property debutNom : "mes MP3s #"
property limite : 100
to getDossier at dropFolder
tell application "Finder" to try
dropFolder's folder monDossier
on error
make new folder at dropFolder with properties {name:monDossier}
end try
end getDossier
to makeNewFolder at dossier from currFolder
set n to 1 + (currFolder's (text -3 thru -1))
tell application "Finder" to repeat
try
set newName to debutNom & ((1000 + n) as string)'s text -3 thru -1
dossier's folder newName
set n to n + 1
on error
make new folder at dossier with properties {name:newName}
return {newName, limite}
end try
end repeat
end makeNewFolder
to getCurrFolder at dossier
tell application "Finder" to tell (debutNom & ((1000 + ¬
(count dossier's folders)) as string)'s text -3 thru -1) to try
tell dossier's folder it to set fileLimit to limite - (count files)
if fileLimit is 0 then error
{it, fileLimit}
on error
my (makeNewFolder at dossier from it)
end try
end getCurrFolder
on adding folder items to this_folder after receiving added_items
set dossier to getDossier at this_folder
tell application "Finder"
set {currFolder, fileLimit} to my (getCurrFolder at dossier)
repeat
if (count added_items) > fileLimit then
move items 1 thru fileLimit of added_items to dossier's folder
currFolder
set added_items to items (fileLimit + 1) thru -1 of added_items
set {currFolder, fileLimit} to my (makeNewFolder at dossier from
currFolder)
else
move added_items to dossier's folder currFolder
exit repeat
end if
end repeat
end tell
end adding folder items to
-------------------
---
kai
Thanks Kai
It's exactly what I understood some times after having posted my
question.
I wrote quite the same code but I will study yours in detail.
Yvan KOENIG
------------------------------
Message: 4
Date: Mon, 09 May 2005 07:39:22 +0100
From: Martin Orpen <email@hidden>
Subject: Re: Script Editor in Tiger: where's the Find gone?
To: AppleScript <email@hidden>
Message-ID: <BEA4C42A.177BD%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
on 9/5/05 03:35, Doug McNutt at email@hidden wrote:
I tend to store my AppleScripts as TEXT anyway. First it was MPW and
now it's
BBEdit worksheets. If you're using scripts for yourself only and not
publishing them for use in other countries there is little to be
gained by
saving a compiled script. Saving as an APPL is another thing.
I think I'm going to start saving my scripts as text too.
Script Debugger text files are catalogued instantly by Spotlight -
unlike
Script Editor text files...
--
Martin Orpen
------------------------------
Message: 5
Date: Mon, 9 May 2005 08:46:53 +0200
From: Le Stang Jean-Baptiste <email@hidden>
Subject: Re: Script Editor in Tiger: where's the Find gone?
To: Martin Orpen <email@hidden>
Cc: AppleScript <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
I don't see really any point in indexing script files by their
variables names unless you give them very explicit names that are
deeply related to your script. But a metadata importer for the
applescript dictionary of an applications or an osax might be
something very cool.
++ JB
------------------------------
Message: 6
Date: Mon, 09 May 2005 07:53:20 +0100
From: Martin Orpen <email@hidden>
Subject: Re: Script Editor in Tiger: where's the Find gone?
To: AppleScript <email@hidden>
Message-ID: <BEA4C770.177C3%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
on 9/5/05 07:39, Martin Orpen at email@hidden wrote:
Script Debugger text files are catalogued instantly by Spotlight -
unlike
Script Editor text files...
Correction: Script Editor text files are also catalogued instantly so
long
as you remove the .applescript suffix.
--
Martin Orpen
------------------------------
Message: 7
Date: Mon, 09 May 2005 00:03:53 -0700
From: Andrew Oliver <email@hidden>
Subject: Re: Startup script not working
To: Gunno Ivansson <email@hidden>,
<email@hidden>
Message-ID: <BEA45969.36F5F%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
On 5/8/05 11:34 PM, "Gunno Ivansson" <email@hidden> wrote:
I am trying to save boottime to a file at start up, but it's not
working.
Here is my script, it is saved as an application and added to my
account's
start up items.
property gCurrentDate : (current date)
property myFilePath : (path to documents folder from user domain as
text) &
"Flex:BootTime" & ((day of gCurrentDate) as string) & ((month of
gCurrentDate) as string)'s text 1 thru 3 & ((year of gCurrentDate) as
string) & ".txt"
on run
try
alias myFilePath
on error
set myPosixPath to POSIX path of myFilePath
do shell script "/usr/sbin/sysctl kern.boottime > " &
myPosixPath
end try
end run
IIRC, you can't use a property like this. The property isn't processed
at
runtime, rather at compile time so it'll continually try to write to
the
filename based on when the script was compiled.
In order to be dynamic, using the script execution time you'll need to
set
myFilePath at runtime by including it in your run handler.
Andrew
:)
------------------------------
Message: 8
Date: Mon, 9 May 2005 08:48:50 +0100
From: Rob Stott <email@hidden>
Subject: Re: [ann] TextCommands 0.1.0
To: Applescript Users <email@hidden>
Cc: has <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="windows-1252"
On 8 May 2005, at 02:48, Tim Mansour wrote:
OK, I'll offer one ... how about a command to take a string and
convert only "ASCII high-bit" characters to/from entities for easy
XHTML use?
I'll second that one. That'd be sooo useful!
r.
---
Rob Stott - Development Team, Trident UK
Connaught Road, Kingswood, East Yorkshire, England
Tel: +44 (0) 1482 828100 Mobile: +44 (0) 7881 811533
My work: http://www.apple.com/uk/creative/trident/
My schedule: http://ical.mac.com/robstott/Robs Schedule
My band: http://www.superscapemusic.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.apple.com/mailman/private/applescript-users/attachments/
20050509/97d4a523/attachment.html
------------------------------
Message: 9
Date: Mon, 09 May 2005 09:51:49 +0200
From: Gunno Ivansson <email@hidden>
Subject: SV: Startup script not working
To: <email@hidden>
Message-ID: <BEA4E335.1785%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
Thanks very much Andrew, now it works
Gunno Ivansson
Den 05-05-09 09.03, skrev "Andrew Oliver" <email@hidden>:
On 5/8/05 11:34 PM, "Gunno Ivansson" <email@hidden> wrote:
I am trying to save boottime to a file at start up, but it's not
working.
Here is my script, it is saved as an application and added to my
account's
start up items.
property gCurrentDate : (current date)
property myFilePath : (path to documents folder from user domain as
text) &
"Flex:BootTime" & ((day of gCurrentDate) as string) & ((month of
gCurrentDate) as string)'s text 1 thru 3 & ((year of gCurrentDate) as
string) & ".txt"
on run
try
alias myFilePath
on error
set myPosixPath to POSIX path of myFilePath
do shell script "/usr/sbin/sysctl kern.boottime > " &
myPosixPath
end try
end run
IIRC, you can't use a property like this. The property isn't
processed at
runtime, rather at compile time so it'll continually try to write to
the
filename based on when the script was compiled.
In order to be dynamic, using the script execution time you'll need
to set
myFilePath at runtime by including it in your run handler.
Andrew
:)
------------------------------
Message: 10
Date: Mon, 9 May 2005 11:04:34 +0200
From: Emmanuel <email@hidden>
Subject: Re: [ann] TextCommands 0.1.0
To: Applescript Users <email@hidden>
Message-ID: <p06002000bea4d7b726e7@[10.0.1.7]>
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
At 8:48 AM +0100 5/9/05, Rob Stott wrote:
On 8 May 2005, at 02:48, Tim Mansour wrote:
OK, I'll offer one ... how about a command to take a string and
convert only "ASCII high-bit" characters to/from entities for easy
XHTML use?
I'll second that one. That'd be sooo useful!
Please, enlighten me. Are you working in a context where UTF-8 is not
a solution? Writing xhmtl or html in Unicode files where you declare
utf-8 in the ad hoc header gets rid of the entities issue, or am I
missing something?
Emmanuel
------------------------------
Message: 11
Date: Mon, 9 May 2005 11:26:47 +0200
From: "Jan-Bultereys" <email@hidden>
Subject: RE: email-addresses are 1big email-address
To: "Brian Johnson" <email@hidden>
Cc: email@hidden
Message-ID:
<email@hidden>
Content-Type: text/plain; charset="iso-8859-1"
Thanks brian for your reply, jean suggested me to use a "return"
instead of ","
but I made a mess of it....
You mentioned "jean's early releases "? Where can I find the "latest"
version?
best regards,jan
----------
From:
applescript-users-
bounces+jan.bultereys=email@hidden on behalf of
Brian Johnson
Sent: Friday, May 6, 2005 20:45 PM
To: Jan-Bultereys
Cc: email@hidden
Subject: RE: email-addresses are 1big email-address
Jan, If you got your example from Jean-Baptiste's early releases, as I
did, and you are trying to modify one of his "raw email" sample
scripts,
and the error affects the way replies are handled, but not the initial
distribution, then I think you just need to insert
set applescript's text item delimiters to {","}
up near "--> customize the following variables as you wish" (or
anywhere
before the "set rawSource to ..." line, as this is where your
distribution
list is being turned into a string). (that's assuming your addresses
are
of the form "email@hiddenver" and not "Foo Bar <user@wherever>"
since the second form bumps into another problem in his sample code).
- brian johnson
On Fri, 6 May 2005, Jan-Bultereys wrote:
Where can I find a good example (for panther and jaguar?)
----------
From: Le Stang Jean-Baptiste
Sent: Friday, May 6, 2005 16:44 PM
To: Jan-Bultereys
Cc: email@hidden
Subject: Re: email-addresses are 1big email-address
On May 6, 2005, at 2:25 PM, Jan-Bultereys wrote:
set |to| to {"address1", "address2", "address3"}
hi, this is a piece in the variable used in Xmail.
It is working but when I receive it in my mailbox (outlook) I will
see
the addresses like 1 big address, meaning
To: address1address2address3
Well I think that you are trying to use one of the (buggy) samples.
This seems to be a coercion from a list of string to a string, like
the
text item delimiter is not set to the good value (it my fault) the
mail has a strange address.
set theRecipients to {"email@hidden","email@hidden",>
...> }
set myAddress to "email@hidden"
send mail to theRecipients from myAddress body "This is the body"
subject "This is the subject" smtp server "mail.myisp.com"
++ Jean-Baptiste
This example will separate the names in oulook but when you double
click on the 1st address,
it will display the 3 addresses in the window "display name".....
set |to| to {"address1; ", "address2; ", "address3; "}
Is there a way fix this issue?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list
(email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list
(email@hidden)
Help/Unsubscribe/Update your Subscription:
email@hidden
This email sent to email@hidden
------------------------------
Message: 12
Date: Mon, 9 May 2005 18:35:40 +0900
From: email@hidden
Subject: Re: [ann] TextCommands 0.1.0
To: Applescript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
Sometimes files one needs to work with have been created in such a
context and they are basically unreadable... Think a page in Japanese
all written in entities :)
One day, all systems will produce proper utf by default but right now
there is still a need for such conversion tools.
Jean-Christophe Helary
On 2005/05/09, at 18:04, Emmanuel wrote:
At 8:48 AM +0100 5/9/05, Rob Stott wrote:
On 8 May 2005, at 02:48, Tim Mansour wrote:
OK, I'll offer one ... how about a command to take a string and
convert only "ASCII high-bit" characters to/from entities for easy
XHTML use?
I'll second that one. That'd be sooo useful!
Please, enlighten me. Are you working in a context where UTF-8 is not
a solution? Writing xhmtl or html in Unicode files where you declare
utf-8 in the ad hoc header gets rid of the entities issue, or am I
missing something?
Emmanuel
------------------------------
Message: 13
Date: Mon, 09 May 2005 11:05:28 +0100
From: Mr Tea <email@hidden>
Subject: AppleScript Doesn't Suck [was - Re: Nice Automator article on
O'Reilly]
To: AS Users <email@hidden>
Message-ID: <BEA4F478.2191D%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
This from Elliotte Harold - dated 8/5/05 9.49 pm:
AppleScript is confusing and poorly designed for *everyone*.
Have I stumbled into the AppleScript Abusers list?
Please, let's try and cut down on the generalised anti-AS rants and
'moving
on, more in sorrow than in anger' essays. These contributions do
nothing to
help the actual users that this list is intended for; they take up
bandwidth, clutter people's inboxes, and obfuscate the useful, focussed
content of the list.
People have opinions, of course, and should feel free to express them
here,
but not when it gets in the way of the real business of the list.
If you really need to let off steam about AS, its shortcomings, and
your
personal frustration with them, may I suggest that the Apple
Discussions
forums might be a better place. Here are the links...
For Tiger:
<http://discussions.info.apple.com/webx?
email@hiddenemail@hidden
86>
For Panther and earlier:
<http://discussions.info.apple.com/webx?email@hidden2jESM5.0@.689b1b66>
Nick
pp Mr Tea
--
------------------------------
Message: 14
Date: Mon, 9 May 2005 11:19:28 +0100
From: Rob Stott <email@hidden>
Subject: Re: [ann] TextCommands 0.1.0
To: Applescript Users <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset="windows-1252"
On 9 May 2005, at 10:35, email@hidden wrote:
Sometimes files one needs to work with have been created in such a
context and they are basically unreadable... Think a page in
Japanese all written in entities :)
Yup. We often get text files which we expect to be able to copy and
paste directly into artworks. Some of these contain 'unusual'
languages and can be a nightmare. It's not unheard of to get a file
that's entirely;
&1234;&4567;&1256;&1234;&4567;&1256; etc
...which is kind of nasty!
r.
---
Rob Stott - Development Team, Trident UK
Connaught Road, Kingswood, East Yorkshire, England
Tel: +44 (0) 1482 828100 Mobile: +44 (0) 7881 811533
My work: http://www.apple.com/uk/creative/trident/
My schedule: http://ical.mac.com/robstott/Robs Schedule
My band: http://www.superscapemusic.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.apple.com/mailman/private/applescript-users/attachments/
20050509/5f2fa65d/attachment.html
------------------------------
Message: 15
Date: Mon, 9 May 2005 05:21:17 -0500
From: "Dennis W. Manasco" <email@hidden>
Subject: Re: Nice Automator article on O'Reilly
To: AppleScript-Users <email@hidden>
Message-ID: <p06210200bea4da06e664@[192.168.123.124]>
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
At 5:33 PM -0400 5/8/05, Gary (Lists) wrote:
...
I'm sure my 8th grade English teacher would love to take a red pen
to this paragraph.
...
The first and last sentences, taken together, make a compelling (and
by that I mean 'ridiculous') argument.
...
Uhh...
Hasn't your reply successfully achieved sophistry?
The quoted post seemed logically sui-argumentum to me.
The first and last sentences reiterate the theme. Thematic
reiteration within an argument is a proven, and usefully, persuasive
rhetorical technique.
Personally, I would have appended the ultimate sentence to the
penultimate, with commas, in a formal paper, but splitting sentences
(and even paragraphs) for effect and readability is common in online
missives.
I've just done it with the last three paragraphs; to emphasize
individual points.
Aside rhetorical arguments, I have to agree with Elliotte to some
degree: AppleScript syntax has a lot of bizarre pitfalls.
Regarding the definition of "programmer":
To say that someone who programs in AppleScript isn't a programmer
is, to my understanding of the word, ridiculous: Programming is
writing in a defined language, AppleScript is a defined language,
q.e.d. writing in AppleScript is programming.
-=-Dennis
.
------------------------------
Message: 16
Date: Mon, 09 May 2005 06:12:21 -0500
From: "John C. Welch" <email@hidden>
Subject: Re: Nice Automator article on O'Reilly
To: "AppleScript User's List" <email@hidden>
Message-ID: <BEA4AFC5.1904CBA%email@hidden>
Content-Type: text/plain; charset="US-ASCII"
On 5/9/05 05:21, "Dennis W. Manasco" <email@hidden> wrote:
To say that someone who programs in AppleScript isn't a programmer
is, to my understanding of the word, ridiculous: Programming is
writing in a defined language, AppleScript is a defined language,
q.e.d. writing in AppleScript is programming.
There is, however, a difference between someone who does the occasional
applescript for whatever reason as the total limit of their
programming and
someone who does it all the time for work and even for play. The
latter is a
"programmer" the former is someone who occasionally programs, and the
thought processes of the two are quite different.
--
Pajamas are indeed comfy, but society dictates we not wear them to
school,
work or the bowling alley.
------------------------------
Message: 17
Date: Mon, 9 May 2005 13:41:20 +0200
From: Mark Smith <email@hidden>
Subject: Re: Nice Automator article on O'Reilly
To: "AppleScript User's List" <email@hidden>
Message-ID: <email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
On May 9, 2005, at 13:12, John C. Welch wrote:
The latter is a
"programmer" the former is someone who occasionally programs, and the
thought processes of the two are quite different.
s/are/may be
------------------------------
Message: 18
Date: Mon, 9 May 2005 08:15:44 -0400
From: Hudson Barton <email@hidden>
Subject: keyboard mapping
To: Applescript_list <email@hidden>
Message-ID: <a06210200bea4f08c5e00@[10.0.1.4]>
Content-Type: text/plain; charset="us-ascii" ; format="flowed"
Is there a way, absent a third party utility, to map a keystroke to
an applescript or a scripted application or an automator thingy?
H.
------------------------------
_______________________________________________
Applescript-users mailing list
email@hidden
http://lists.apple.com/mailman/listinfo/applescript-users
End of Applescript-users Digest, Vol 2, Issue 304
*************************************************