Re: VB or c++ call in script
Re: VB or c++ call in script
- Subject: Re: VB or c++ call in script
- From: Rajeev Kumar <email@hidden>
- Date: Fri, 17 Sep 2004 05:18:54 +0100 (BST)
Hi list
Can I call VB form or C++ programms in my apple script? I have a lot of queries but I can never list without such any positive response. Can I call my macperl or perl programms in applescript? How can I search a special chracters like greek or arrow in any QXD file?
I am using OS 9.2 and Quark 4.11. Can somebody guide me please I need all of your support.
email@hidden wrote:
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: "choose from list" with custom buttons? (Paul Berkowitz)
2. RE: Switch to White on Black (was Script Editor Styles Format
Change Script) (Hamish Graham)
3. Re: Switch to White on Black (was Script Editor Styles Format
Change Script) (Paul Berkowitz)
4. Re: Switch to White on Black (w!
as Script
Editor Styles Format
Change Script) (Gnarlodious)
5. Standard folder names, etc. (was: Applescript-users Digest,
Vol 1, Issue 41) (kai)
6. Re: Switch to White on Black (was Script Editor Styles Format
Change Script) (Michelle Steiner)
7. Re: Switch to White on Black (was Script Editor Styles Format
Change Script) (Joseph Weaks)
8. automatic unmount (Stefan Eriksson)
9. Count lines in a textfile (Stefan Eriksson)
10. Re: Count lines in a textfile (Michelle Steiner)
11. Re: Count lines in a textfile (Malcolm Fitzgerald)
12. Re: automatic unmount (Malcolm Fitzgerald)
13. Re: Count lines in a textfile (Paul Berkowitz)
14. Re: Count lines in a textfile (Malcolm Fitzgerald)
15. Re: Count lines in a textfile (Gnarlodious)
16. Re: Count lines in a textfile (Paul Berkowitz)
17. Re: Count lines in a textfile (Christopher Nebel)
18. Re: Count lines in a textfile
(Gnarlodious)
----------------------------------------------------------------------
Message: 1
Date: Thu, 16 Sep 2004 12:18:58 -0700
From: Paul Berkowitz
Subject: Re: "choose from list" with custom buttons?
To: AppleScript-Users
Message-ID:
Content-Type: text/plain; charset="US-ASCII"
It's not usually a good idea to remove a Cancel button in any case. It makes
users feel trapped, with no escape - even if _you_ know that the OK button
may be doing nothing in this instances, users don't know that. Always give
them a chance to to get out of there.
--
Paul Berkowitz
> From: Gnarlodious
> Date: Thu, 16 Sep 2004 12:50:25 -0600
> To: Applescript
> Subject: Re: "choose from list" with custom buttons?
>
> No.
> > --
Gnarlie
>
> Entity Martha Espinosa spoke thus:
>
>> Is there a way to only get one button?
>>
------------------------------
Message: 2
Date: Thu, 16 Sep 2004 20:37:03 +0100
From: Hamish Graham
Subject: RE: Switch to White on Black (was Script Editor Styles Format
Change Script)
To: AppleScript-Users Users
Message-ID:
Content-Type: text/plain; charset=US-ASCII; format=flowed
Problem might be that the shortcut is really ctrl-opt-cmd-* at least
for me anyway, using the "8" on the numpad doesn't work but the "*"
does... and shift-8 on the main keyboard equals *
On 15 Sep 2004, at 22:44, Paul Berkowitz wrote:
> It still seems to me that the Universal Access pref "Switch to White
> on Black" is the best way to do it.
> Gnarlie says that on her machine t!
he
shortcut ctrl-opt-cmd-8 doesn't
> work.
> It DOES work here OMM. I think you also need to have "Turn on full
> Keyboard
> access" in Keyboard & Mouse/Keyboard Shortcut prefs (in System prefs).
> Try
> that, Gnarlie.
>
> --
> Paul Berkowitz
------------------------------
Message: 3
Date: Thu, 16 Sep 2004 13:49:44 -0700
From: Paul Berkowitz
Subject: Re: Switch to White on Black (was Script Editor Styles Format
Change Script)
To: AppleScript-Users
Message-ID:
Content-Type: text/plain; charset="US-ASCII"
No. Incorrect. ctrl-opt-cmd-8 on the main keyboard works, whereas
ctrl-opt-cmd-* (that is ctrl-opt-cmd-shift-8) on the main keyboard does not
work. Since NONE of the modifier keys (ctrl-opt-cmd-shift) even exists on
the number pad, only on the main keyboard, I'm at !
a bit of
a loss as to why
you'd try the number-pad at all.
OMM, holding down ctrl-opt-cmd on the main keyboard, then neither 8 NOR *
works. Only 8 on the main keyboard. ctrl-opt-cmd-8 on the main keyboard
works, and nothing else. Same with both left or right sets of ctrl-opt-cmd
keys.
(Keyboard is the standard Apple keyboard that comes with a desktop G5.)
--
Paul Berkowitz
> From: Hamish Graham
> Date: Thu, 16 Sep 2004 20:37:03 +0100
> To: AppleScript-Users Users
> Subject: RE: Switch to White on Black (was Script Editor Styles Format Change
> Script)
>
> Problem might be that the shortcut is really ctrl-opt-cmd-* at least
> for me anyway, using the "8" on the numpad doesn't work but the "*"
> does... and shift-8 on the main keyboard equals *
>
>
>
> On 15 Sep 2004, at 22:44, Paul Berkowitz wrote:
>>!
It still
16 Sep
2004 14:55:07 -0600
From: Gnarlodious
Subject: Re: Switch to White on Black (was Script Editor Styles Format
Change Script)
To: Applescript
Message-ID:
Content-Type: text/plain; charset="US-ASCII"
I don't know. Under no circumstances will it work for me. But it works on my
laptop. Thanks for letting me know it SHOULD do something.
-- Gnarlie
Entity Hamish Graham spoke thus:
> Problem might be that the shortcut is really ctrl-opt-cmd-* at least
> for me anyway, using the "8" on the numpad doesn't work but the "*"
> does... and shift-8 on the main keyboard equals *
>
>
>
> On 15 Sep 2004, at 22:44, Paul Berkowitz wrote:
>> It still seems to me that the Universal Access pref "Switch to White
>> on Black" is the best way to do it.
>> Gnarlie says that o!
n her
BR>Vol 1,
Issue 41)
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On Wed, 15 Sep 2004 13:48:32 -0700, Paul Berkowitz
wrote:
> On 9/15/04 12:59 PM, "kai" wrote:
>
>> On Wednesday, September 15, 2004, at 08:47 pm, some dipstick wrote:
>>
>>> set myFile to (path to "docs" as Unicode text) & "Awake_Times" as
>>> file
>>> specification
>>
>> Sorry folks. Been out of circulation for a while - and it shows! Wrong
>> Subject heading, wrong date, wrong digest. Still, I think the answer
>> might have been close... ;-)
>
> In Panther you usually don't need the obscure 4-character codes for
> 'path
> to' although they still work - there are lots of new "special
folders".
>
> path to documents folder
Funnily enough, I was comparing notes on this subject only recently.
While some standard folder names are obviously inherited from previous
Mac systems [1], the new terms exclusive to Panther [2] seem to reflect
more comprehensively the structure in OS X. Interestingly, the code
"cusr", which translates as in Jaguar, appears to
have become in Panther.
[1] e.g: "boot"/, "macs"/ and
"desk"/ (or )
[2] e.g: "dlib"/, "pdoc"/,
"mdoc"/, "pubb"/, "site"/
and "µdoc"/
> And if the file in fact exists, then 'as alias' is better than 'as file
> specification'.
Agreed. (I think the OP asked specifically about 'file'.) :-)
> But I can't find the original message to check because!
it's
apparently
> from
> August 6 (! I'm sure he's found an answer by now;-),
I would think/hope so... ;-)
> ...is no longer in my email client, and can't be searched for in the
> list's
> archives without at least knowing the real thread. No thread seems
> obvious
> from the August or July archives.
For the record, it was "Can't make...into a file". Again, apologies for
the confusion. I've just put it down to a (hopefully) temporary
aberration on my part - combined with a bit of an ongoing battle that I
currently seem to be having with my email software.
----
On Wed, 15 Sep 2004 19:03:12 -0600, Gnarlodious
wrote:
> Entity kai spoke thus:
>
>> Sorry folks. Been out of circulation for a while
>
> I guess so, what brought you back, the thrilling prospect of using
> HTML?
Why - I was missing you guys, of course! (!
I suppose
the real question
is what took me away - but you really don't want to go there.) ;-)
I may still not be around that much for a while - but it's good to get
a chance to drop by.
>> Wrong Subject heading, wrong date, wrong digest.
> Wrong appellation too, there aren't any dipsticks here :-)
That may have been the case during my absence, Gnarlie... :-)
----
On Wed, 15 Sep 2004 18:45:21 -0700, Paul Berkowitz
wrote:
> Well, he was referring to himself, so that's OK. Self-denigration is
> always tolerated...
Always happy to oblige, Paul.
---
kai
------------------------------
Message: 6
Date: Thu, 16 Sep 2004 14:40:43 -0700
From: Michelle Steiner
Subject: Re: Switch to White on Black (was Script Editor Styles Format
Change Script)
To: Applescript Users
Message-ID:
<email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
On Sep 16, 2004, at 1:49 PM, Paul Berkowitz wrote:
> OMM, holding down ctrl-opt-cmd on the main keyboard, then neither 8
> NOR *
> works. Only 8 on the main keyboard. ctrl-opt-cmd-8 on the main keyboard
> works, and nothing else. Same with both left or right sets of
> ctrl-opt-cmd
> keys.
On my machine (G4 iMac with original keyboard), command-option-control
works with either the 8 on the keyboard or the * on the numeric keypad.
--
Like father, like son: Only one term!
------------------------------
Message: 7
Date: Thu, 16 Sep 2004 16:48:20 -0500
From: Joseph Weaks
Subject: Re: Switch to White on Black (was Script Editor Styles Format
Change Script)
To: AppleScript-Users List
Message-ID:
<email@hidden>
Content-Type: text/plain; charset=US-ASCII; format=flowed
On Sep 16, 2004, at 3:49 PM, Paul Berkowitz wrote:
> OMM, holding down ctrl-opt-cmd on the main keyboard, then neither 8
> NOR *
> works. Only 8 on the main keyboard. ctrl-opt-cmd-8 on the main keyboard
> works, and nothing else. Same with both left or right sets of
> ctrl-opt-cmd
> keys.
ctrl-opt-cmd * (on number pad) works for me. as does 8 on the main
keyboard (but not shift-8)
OMM (=G4 466)
Joe Weaks
------------------------------
Message: 8
Date: Fri, 17 Sep 2004 00:58:43 +0200
From: Stefan Eriksson
Subject: automatic unmount
To: email@hidden
Message-ID:
Content-Type: text/plain; charset="iso-8859-1"
Trying to create an application that au!
tomatic
mounts a servervolume if
a certain application is started and the opposite aswell, if the
application is quit, then the servervolume will be unmounted... this is
so far i“ve got on the unmountpart:
set is_running to 0
repeat
tell application "Finder" to exists process "TextEdit"
set result to is_running
if is_running is "false" then
tell application "Finder"
eject disk "kain" -- Mounted name of fileserver
end tell
end if
delay 10
end repeat
Works just fine, aslong as TextEdit is running, variable is_running is
true, if TextEdit is quit, is_running turns to false, but servervolume
stays, any ideas about this ?
Best regards, Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2001 bytes
Desc: not available
Url :
http://lists.apple.com/mailman/private/applescript-users/attachments/20040917/1c4292d4/attachment.bin
------------------------------
Message: 9
Date: Fri, 17 Sep 2004 01:02:34 +0200
From: Stefan Eriksson
Subject: Count lines in a textfile
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Anyone got a tip on how to count number of lines in a text-document,
i“ve been testing to read how many ASCII Character 10/13 there are in a
text-file but can“t get some accurate figures out of it... any ideas ?
Best regards, Stefan
------------------------------
Message: 10
Date: Thu, 16 Sep 2004 17:03:44 -0700
From: Michelle Steiner
Subject: Re: Count lines in a textfile
To: Applescript Users
Mess!
age-ID:
<email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On Sep 16, 2004, at 4:02 PM, Stefan Eriksson wrote:
> Anyone got a tip on how to count number of lines in a text-document,
> i“ve been testing to read how many ASCII Character 10/13 there are in
> a text-file but can“t get some accurate figures out of it... any ideas
> ?
How do you define a line? There really is no such thing in text, so
far as Applescript is concerned; there are characters, words, and
paragraphs. Some applications may define more text entities in their
dictionaries, though.
If a line is considered to be the same as a paragraph, then this will
do it:
count paragraphs of the_text
Or will it? If there is double spacing between paragraphs, then that
code will return approximately double the number of actual paragraphs
because each blank line will be cou!
nted as a
paragraph.
So before you can count the "lines" of a text file, you have to define
"line."
-- Michelle
--
In theory, theory and practice are the same.
In practice, they're not. --Yogi Berra
------------------------------
Message: 11
Date: Fri, 17 Sep 2004 10:17:08 +1000
From: Malcolm Fitzgerald
Subject: Re: Count lines in a textfile
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Stefan Eriksson wrote:
> Anyone got a tip on how to count number of lines in a text-document,
> i“ve been testing to read how many ASCII Character 10/13 there are in a
> text-file but can“t get some accurate figures out of it... any ideas ?
count paragraphs of (read (choose file {})))
--
Malcolm Fitzgerald ph : 02 9318 0877
Database Manager fa!
x: 02
9318 0530
The Australian Society of Authors
------------------------------
Message: 12
Date: Fri, 17 Sep 2004 10:27:08 +1000
From: Malcolm Fitzgerald
Subject: Re: automatic unmount
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Stefan Eriksson wrote:
> Trying to create an application that automatic mounts a servervolume if
> a certain application is started and the opposite aswell, if the
> application is quit, then the servervolume will be unmounted... this is
> so far i“ve got on the unmountpart:
>
> set is_running to 0
> repeat
> tell application "Finder" to exists process "TextEdit"
> set result to is_running
> if is_running is "false" then
> tell application "Finder"
> eject disk "kain" -- Mo!
unted
name of fileserver
> end tell
> end if
> delay 10
> end repeat
>
Two problems.
first, you set result to is_running instead of setting is_running to result.
second, In your script "false" is a string and you are comparing it to a
boolean.
try this:
repeat
tell application "Finder"
if (exists process "TextEdit") then
eject disk "kain" -- Mounted name of fileserver
end if
end tell
delay 10
end repeat
--
Malcolm Fitzgerald ph : 02 9318 0877
Database Manager fax: 02 9318 0530
The Australian Society of Authors
------------------------------
Message: 13
Date: Thu, 16 Sep 2004 17:31:36 -0700
From: Paul Berkowitz
Subject: Re: Count lines in a textfile
To: AppleScript-Users
Message-ID:
Content-Type: text/plain;
charset="ISO-8859-1"
On 9/16/04 5:17 PM, "Malcolm Fitzgerald" wrote:
> Stefan Eriksson wrote:
>
>> Anyone got a tip on how to count number of lines in a text-document,
>> i“ve been testing to read how many ASCII Character 10/13 there are in a
>> text-file but can“t get some accurate figures out of it... any ideas ?
>
> count paragraphs of (read (choose file {})))
Why the {}? It doesn't do anything (fortunately - otherwise it would error).
--
Paul Berkowitz
------------------------------
Message: 14
Date: Fri, 17 Sep 2004 10:53:17 +1000
From: Malcolm Fitzgerald
Subject: Re: Count lines in a textfile
To: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=us-ascii; format=flowed
On 9/16/04 5:17 PM, "Malcolm Fitzgerald"
wrote:
>>count paragraphs of (read (choose file {})))
Paul Berkowitz asked:
> Why the {}? It doesn't do anything (fortunately - otherwise it would error).
Emmanuel may know better than me :) Smile formats my code that way when
it compiles.
--
Malcolm Fitzgerald ph : 02 9318 0877
Database Manager fax: 02 9318 0530
The Australian Society of Authors
------------------------------
Message: 15
Date: Thu, 16 Sep 2004 18:54:08 -0600
From: Gnarlodious
Subject: Re: Count lines in a textfile
To: Applescript
Message-ID:
Content-Type: text/plain; charset="iso-8859-1"
Entity Stefan Eriksson spoke thus:
> Anyone got a tip on how to count number of lines in a text-document,
> i“ve been testing to read how many AS!
CII
Character 10/13 there are in a
> text-file but can“t get some accurate figures out of it... any ideas ?
set filePath to POSIX path of (choose file)
do shell script "cat " & the quoted form of filePath & " | tr '\\r' '\\n' |
=== message truncated ===
Yahoo! India Matrimony: Find your life partner
online.
_______________________________________________
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