applescript-users Mailing List http://lists.apple.com/archives/applescript-users/2009/Nov/index.html applescript-users Mailing List Sat, 07 Nov 2009 16:00:31 +0000 Re: Adding Spotlight Metadata http://lists.apple.com/archives/applescript-users/2009/Nov/msg00034.html Reply to list

Le 5 nov. 2009 à 23:34, Hagimeno a écrit :

[...]

Unless I'm wrong, an extended attribute is basically a name/value pair  
associated to a filesystem item (file, folder...), where the value is  
an arbitrary sequence of bytes. 
That is, extended attributes aren't typed; [...]
]]>
Re: spurious timeout on nth Apple event on Snow Leopard http://lists.apple.com/archives/applescript-users/2009/Nov/msg00033.html Reply to list

On Nov 6, 2009, at 23:20, Christopher Nebel wrote in the thread  
"system info delay":

[...]

I cannot confirm this. I get values far under and over 65000 - on  
subsequent runs. So I'm a bit skeptical about the "it's only a counter  
problem" assumption. 

Config: Mac Pro, 10 GB RAM, OS 10.6. [...]
]]>
Re: How can we execute remote AppleScript? http://lists.apple.com/archives/applescript-users/2009/Nov/msg00032.html Reply to list

At 3:43 PM -0500 4/3/07, Wallace, William wrote:
[...]

I found this. Forget my post about this issue....  
 --
Takaaki Naganoya
Piyomaru Software
http://piyo.piyocast.com
email@hidden  
 PiyoCast Web (Podcasting with Music!)
http://www.piyocast.com
Free AppleScript Library "AS Hole"
http://www. [...]
]]>
Re: How can we execute remote AppleScript? http://lists.apple.com/archives/applescript-users/2009/Nov/msg00031.html Reply to list

Hi,  
 There are some facts which I ensured...  
(1)Remote AppleEvent setting exists on System Preference on Mac OS X  
10.6.1 (Yes. It exists). 
(2)Mac OS X 10.4.11 environment accepts Remote AppleEvent (Send remote  
AE from 10.6.1) 
(3)Mac OS X 10.6. [...]
]]>
Re: system info delay http://lists.apple.com/archives/applescript-users/2009/Nov/msg00030.html Reply to list

[...]

Not if the delay is consistent -- the bug you're referring to only  
happens every 65,000th time.  The most likely culprit is something  
about your network, since among the bits "system info" returns is your  
IP address. 

  --Chris Nebel
AppleScript Engineering   [...]
]]>
Error -609 http://lists.apple.com/archives/applescript-users/2009/Nov/msg00029.html Reply to list

I recently said ...    > quoted text
     Fixed the problem!    My original script did something like this ...      		tell application "Mail"  			try  				set frontViewer to (some message viewer whose index is 1)  			on error  				error "A message viewer window must be open and frontmost in Mail. [...]
]]>
Re: activating a function key http://lists.apple.com/archives/applescript-users/2009/Nov/msg00028.html Reply to list
[...]

If I remember correctly:  
 tell application "System Events" to keystroke "F1"  
 --
I WILL NOT SHOW OFF
	Bart chalkboard Ep. 7F21  
 
]]>
Re: moving disc icons http://lists.apple.com/archives/applescript-users/2009/Nov/msg00027.html Reply to list
tell application "Finder"  	activate  	set diskCount to (count disks) - 3  	set whichDisk to random number of diskCount  	set pos to {}  	set pos to desktop position of disk whichDisk  	set rightMost to item 1 of pos  	set topMost to item 2 of pos  	set x to rightMost  	repeat until x < 100  		set x to x - 2  		set desktop position of disk whichDisk to {x, topMost}  	end repeat  	set desktop position of disk whichDisk to pos  end tell   On Nov 5, 2009, at 5:26 PM, Bob Cuilla wrote:  > quoted text
       
]]>
to open a bundle to see the contents http://lists.apple.com/archives/applescript-users/2009/Nov/msg00026.html Reply to list

Hi all,
I want to open a .bundle via AppleScript to view the contents.
Is there a way to do this?  
Greetings, Ronald This email sent to email@hidden








  References:   

[...]

How we can execute remote AppleScript?

 Previous by thread:
Re: Adding Spotlight Metadata

 Next by thread: [...]
]]>
How we can execute remote AppleScript? http://lists.apple.com/archives/applescript-users/2009/Nov/msg00025.html Reply to list

On Mac OS X 10.6, I could not find the application which accepts  
remote events via network. 
Even AppleScript applet does not accepts remote event. 

 Is there a way to make the applet remote event aware?  
 --
Takaaki Naganoya
Piyomaru Software
http://piyo.piyocast. [...]
]]>
activating a function key http://lists.apple.com/archives/applescript-users/2009/Nov/msg00024.html Reply to list
Howdy all I am new to this list. I want to activate a function key. I know I can do the below:   	tell application "System Events" to keystroke "f" using {command down}     But what is the syntax to activate a function key?  Thanks for any help.        louie  email@hidden               
]]>
Re: moving disc icons http://lists.apple.com/archives/applescript-users/2009/Nov/msg00023.html Reply to list
On Nov 5, 2009, at 4:26 PM, Bob Cuilla wrote:  > quoted text
   Try this ...      	tell application "Finder"  		...    		set desktop position of the result to deskPos     where 'the result' is an alias to an item on the desktop.          
]]>
moving disc icons http://lists.apple.com/archives/applescript-users/2009/Nov/msg00022.html Reply to list
I would like to move a disk volume icon on the desktop.  Can this be  
done with AS? 

 Bob Cuilla
]]>
Error -609 http://lists.apple.com/archives/applescript-users/2009/Nov/msg00021.html Reply to list

I have a script that gets some of Mail's Mailbox Behaviors and if not  
set correctly it ... 
1. Quits Mail; 
2. Writes the correct behaviors to com.apple.mail.plist; 
3. Activates Mail. 

In Snow Leopard, it works perfectly. 
In Leopard (10.5.8), I get Error = -609, Mail got an error. [...]
]]>
Re: Detecting when URL has been loaded in Safari??? http://lists.apple.com/archives/applescript-users/2009/Nov/msg00020.html Reply to list
Dave,  Would it not be easier to use the Safari 'do _javascript_' command, as in:  -------------------------------------------  tell application "Safari"  	set the URL of the front document to "http://some.web.page"  	delay 2 --the page begins loading  	repeat with i from 1 to 20--check 20 times  		if (do _javascript_ "document.readyState" in document 1 is "complete" then  			exit repeat--the page has successfully loaded  		else  			delay 1  		end if  	end repeat--go back and check again after the one second delay  end tell  ---------------------------------------------  This script is shorter, at least. You might add some 'try ..... end try'  statements to catch errors.        Roy     ==========Your script=========  on check_Safari_page_loaded(wait_secs)  	set loaded to false  	set cnt to 0  	repeat until loaded  		set cnt to cnt + 1  		delay 0.5  		tell application "System Events" to ¬  			tell process "Safari"  				set x to (value of static text 1 of window 1 as text)  				set y to ""  				if exists group 1 of window 1 then  					if exists (static text 1 of group 1 of window 1) then set y to (value of static text 1 of group 1 of window 1 as text)  				end if  				if y = "" then  					set w_Name to x  				else  					set w_Name to y  				end if  				set loading to false  				if (w_Name begins with "Contacting") then set loading to true  				if (w_Name begins with "Loading") then set loading to true  				if (w_Name begins with "Untitled") then set loading to true  				if loading and not (cnt > (wait_secs * 2)) then  					set loaded to false  				else  					set loaded to true  					exit repeat  				end if  			end tell -- process Safari  	end repeat  	if cnt > wait_secs * 2 then set loaded to false  	return loaded  end check_Safari_page_loaded     ------------------------ check_Safari_page_loaded handler ------------------------          
]]>
Re: Detecting when URL has been loaded in Safari??? http://lists.apple.com/archives/applescript-users/2009/Nov/msg00019.html Reply to list
Dave,    I was searching AS subjects looking for a discussion I thought I remembered from September  when I noticed your question from back on 28-Sep. Here is a handler I use to detect that a  page is loaded in Safari. It was refined from messages I discovered when I was looking for  the same thing around the first of this year.     The article I found was: http://www.macosxhints.com/article.php?story=20071015132722688     This was I ended up with:        ------------------------ check_Safari_page_loaded handler ------------------------     on check_Safari_page_loaded(wait_secs)  	set loaded to false  	set cnt to 0  	repeat until loaded  		set cnt to cnt + 1  		delay 0.5  		tell application "System Events" to ¬  			tell process "Safari"  				set x to (value of static text 1 of window 1 as text)  				set y to ""  				if exists group 1 of window 1 then  					if exists (static text 1 of group 1 of window 1) then set y to (value of static text 1 of group 1 of window 1 as text)  				end if  				if y = "" then  					set w_Name to x  				else  					set w_Name to y  				end if  				set loading to false  				if (w_Name begins with "Contacting") then set loading to true  				if (w_Name begins with "Loading") then set loading to true  				if (w_Name begins with "Untitled") then set loading to true  				if loading and not (cnt > (wait_secs * 2)) then  					set loaded to false  				else  					set loaded to true  					exit repeat  				end if  			end tell -- process Safari  	end repeat  	if cnt > wait_secs * 2 then set loaded to false  	return loaded  end check_Safari_page_loaded     ------------------------ check_Safari_page_loaded handler ------------------------     "static text 1 of window 1" is the text shown at the bottom of the Safari window if you do a  "View>Show Status Bar" command.  • for a brand-new window that hasn't loaded a single item, this text has the value "Untitled"  • if the server is being contacted, the text begins with "Contacting"  • if an item is being sent (i.e. a jpeg or some text), the text begins wit "Loading"  if more than one window is open, then the status bar text could be in  "static text 1 of group 1 of window 1", thus the second variable and the switch.  (I discovered this when the handler failed and I started digging for the reason).     I do several scripts where I need to load a page where I want to print the contents   to a PDF. These pages sometimes take a fair amount of time to load. I had to have  a reliable way to ensure that they were completely loaded before I tried to print.  This handler works 95-98% of the time.     The wait_secs parameter is the time, in seconds, to wait for the page to load. If the  page hasn't loaded when the wait time has passed, the handler returns with a value  of false.  If the page is loaded, it returns with a value of true.     Hope this helps. Sorry I didn't see this at the time you were asking your question.     Jim Brandt            
]]>
Re: Adding Spotlight Metadata http://lists.apple.com/archives/applescript-users/2009/Nov/msg00018.html Reply to list

Le 5 nov. 2009 à 12:36, Hagimeno a écrit :

[...]

Yes, could be a bit more documented... ;-)  
 Fortunately, there's the -h option:  
 	xattr -h  
Moreover, xattr is a python script which, in turn, invokes another  
python script, for example: 

 	/usr/bin/xattr-2. [...]
]]>
RE: system info delay http://lists.apple.com/archives/applescript-users/2009/Nov/msg00017.html Reply to list
Hi Luther,

this "could" be related to a bug present in Snow Leopard about random timeout  related to Apple Events.
Search topics for "Timeout (Silence)" and answer of Chris Nebel from Apple.

Steve and Alex



 
]]>
Re: Adding Spotlight Metadata http://lists.apple.com/archives/applescript-users/2009/Nov/msg00016.html Reply to list
Hi Axel,

many thanks for the input. Where I can find help about parameters?
Seems there is not man pages for xattr.

Steve



 
]]>
Re: system info delay http://lists.apple.com/archives/applescript-users/2009/Nov/msg00015.html Reply to list

Le 3 nov. 2009 à 22:57, Luther Fuller a écrit :

[...]

Difficult to tell... :-) 
Now, it is clear that the "system info" command queries various parts  
of the system so as to gather the needed data; it is thus possible  
that the delay isn't an AppleScript one at all but reflects some   [...]
]]>
Re: Adding Spotlight Metadata http://lists.apple.com/archives/applescript-users/2009/Nov/msg00014.html Reply to list

Le 2 nov. 2009 à 17:41, Hagimeno a écrit :

[...]

Are you thinking about attributes with binary instead of textual values? 
If you've a sample file with such attributes, perhaps could you have a  
look at it with 
	xattr -p -x <attrname> <filepath>  [...]
]]>
Preserve file info comment when sending a file from a Mac to Windows and the other way around http://lists.apple.com/archives/applescript-users/2009/Nov/msg00013.html Reply to list
What happens to the (Spotlight-)comment field of an (is this case Excel-) file when I transfer the file from a Mac to a Windows XP platform? Can a Windows user retrieve the Spotlight comment information in some way?  Or, much more important, the other way around: Can I, on a Windows machine, store information in other places than the filename or the worksheet itself and preserve that information when I send an Excel file from a Windows platform to the Mac? So that I can pick up the info and store it in a variable.     Bert.        
]]>
Undo History List http://lists.apple.com/archives/applescript-users/2009/Nov/msg00012.html Reply to list

I'm relatively new to AppleScript, so I'm not sure if the following is  
possible, or where to begin looking. I'm hoping someone here can help: 

I want to implement an Undo History List in Final Cut Pro. Would this  
be possible to do with AppleScript? [...]
]]>
system info delay http://lists.apple.com/archives/applescript-users/2009/Nov/msg00011.html Reply to list
Snow Leopard 10.6.1. While trying to test a script, I encountered a long delay where there should not be any delay. I finally traced the problem to a single command. Here is the script ...     set elapsedTime to (current date)  system info  (current date) - elapsedTime      This script returns 32 sec on my Mac.  The system info command belongs to the StandardAdditions.osax  and until today, I had not noticed any delay at all.  Switched from a Standard to an Admin user ... same result.  Restarted ... this fixed the problem.  Now, I'm curious. Anyone know anything specific about why this happened?         
]]>
On idle application crashing http://lists.apple.com/archives/applescript-users/2009/Nov/msg00010.html Reply to list

Title: On idle application crashing 



I have an Applescript application that runs on idle. It basically triggers three other scripts to run, then waits a couple minutes, then does it again. 

Recently, the script began crashing after it has been running for a couple of days. [...]
]]>
Re: how to convert *space* to %20 http://lists.apple.com/archives/applescript-users/2009/Nov/msg00009.html Reply to list

I recommend to use URI Escape.osax.

http://homepage.mac.com/tkurita/scriptfactory/en/contents.html#URIEscape

=======================================================
 Tetsuro KURITA
  E-mail: email@hidden
  http://homepage.mac.com/tkurita/scriptfactory/ [...]
]]>
Is there a decent IRC channel for AppleScript Users? http://lists.apple.com/archives/applescript-users/2009/Nov/msg00008.html Reply to list
While I am fine with the mailing list for archival purposes, sometimes
I just like the chatter on an IRC channel. Does anyone know of a
decent irc channel for AppleScript Users?

seyDoggy
 
]]>
Adding Spotlight Metadata http://lists.apple.com/archives/applescript-users/2009/Nov/msg00007.html Reply to list

Hi,

even is is not true AS question (but is related to) how is possible to add a metadata to a file with integer or real value?

This command that can be invoked with do shell script works:

xattr -w com.apple.metadata:myName iPhone /Users/alex/Desktop/hello. [...]
]]>
Re: how to convert *space* to %20 http://lists.apple.com/archives/applescript-users/2009/Nov/msg00006.html Reply to list
[...]
]]>
Fwd: can't make {to recipient} from {get recipient of theMessage} http://lists.apple.com/archives/applescript-users/2009/Nov/msg00005.html Reply to list

Sorry, used wrong "from" to send the message    Begin forwarded message:   From: James Udo Ludtke <email@hidden>   Date: 2009  November  1 3:57:17 PM EST   To: email@hidden   Subject: Re: can't make {to recipient} from {get recipient of theMessage}    > quoted text

[...]

Axel,  Merci beaucoup. [...]
]]>
Re: how to convert *space* to %20 http://lists.apple.com/archives/applescript-users/2009/Nov/msg00004.html Reply to list
[...]

An AS strict solution

[...]

encode("Hello Alice", space, "%20")  
 on encode(x, y, z)
	tid(y)
	set x to text items of x
	tid(z)
	return x as string
end encode  
 on tid(x)
	set AppleScript's text item delimiters to x
end tid

[...]
]]>
Re: Encoding text file to write XML http://lists.apple.com/archives/applescript-users/2009/Nov/msg00003.html Reply to list

[...]

I wonder what suggests to you that % is to escape...  
Also, if your xml includes attributes, you may have to escape the  
double quotes and/or the apostroph with " and ', otherwise  
how will you insert quotes in an attribute's value? [...]
]]>
Re: can't make {to recipient} from {get recipient of theMessage} http://lists.apple.com/archives/applescript-users/2009/Nov/msg00002.html Reply to list

Le 1 nov. 2009 à 06:18, James Udo Ludtke a écrit :

[...]

Indeed, a message's recipient is an object. 
On the other hand, a "make new ... with properties ..." expects a  
record whose items define some or all of the distinctive properties of  
the object -here, a recipient- to be built. [...]
]]>
Re: how to convert *space* to %20 http://lists.apple.com/archives/applescript-users/2009/Nov/msg00001.html Reply to list
On apple's site somewhere there's a great script to encode text to URL  
encoded text. If you google AppleScript URL encoded text I'm sure  
you'll find it. 

 Sent from my iPhone  
 On 1. nov. 2009, at 09.51, CJ Kelley <email@hidden> wrote:

[...]
]]>
how to convert *space* to %20 http://lists.apple.com/archives/applescript-users/2009/Nov/msg00000.html Reply to list

Hi all,    I am writing an applescript application that will send an http request to the Alice bot. My question is, how do i convert a space to %20?     If i send a message like this: 
    "Hello Alice"     I get "400 - Bad Request"     Thanks in advance! [...]
]]>