From the iPhone
Apple, Internet, Programming No Comments »Iphone + firmware 2.0 + wordpress app = incredible ![]()
Iphone + firmware 2.0 + wordpress app = incredible ![]()
| As you can see from the picture, yesterday I went to the Apple Store of Miami Beach, in Lincoln Road and they have already the Airport Extreme at 179 USD! Probably is because of the Superbowl that this year will be in Miami, but anyway is strange because from the Apple Store Online you can’t receive it before 2-3 weeks!! |
Another AppleScript! This time is for copying the lyrics of the current playing song in iTunes to a file. I use this with Proxy, a useful program that can bind actions to keys and show result/doing something with apps/etc. I’ve configured it to display a screen box with the lyric of the song (readed from the file created by this script) just by pressing Control+2
The script:
on write_to_file(this_data, target_file, append_data)
try
set the target_file to the target_file as text
set the open_target_file to ¬
open for access file target_file with write permission
if append_data is false then ¬
set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof
close access the open_target_file
return true
on error
try
close access file target_file
end try
return false
end try
end write_to_file
tell application “iTunes”
copy (get name of current track) to trackName
copy (get artist of current track) to trackArtist
copy (get lyrics of current track) to tracklyric
end tell
set this_story to trackName & ” - ” & trackArtist & return & tracklyric
set this_file to (((path to desktop folder) as text) & “MyLir”)
my write_to_file(this_story, this_file, false)
Let’s start a new section of my website! In those days I’m looking at the AppleScript and I found that it’s really powerful and integrated in OSX!!
This script I made is for automatically open iSync, syncronize all the devices and close it, notifying the result in a Growl box!
I’m using it with cron twice a day, so I don’t have to remind to sync…
Enjoy it!
tell application “iSync”
synchronize
repeat
delay 5
if syncing is true then exit repeat
end repeat
repeat
delay 5
if sync status = 2 then exit repeat
end repeat
delay 1
set lastdate to last sync
quit
end tell
tell application “GrowlHelperApp”
– Make a list of all the notification types
– that this script will ever send:
set the allNotificationsList to ¬
{”Finito”}
– Make a list of the notifications
– that will be enabled by default.
– Those not enabled by default can be enabled later
– in the ‘Applications’ tab of the growl prefpane.
set the enabledNotificationsList to ¬
{”Finito”}
– Register our script with growl.
– You can optionally (as here) set a default icon
– for this script’s notifications.
register as application ¬
“MySyncNow” all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application “Script Editor”
– Send a Notification…
notify with name ¬
“Finish” title ¬
“Sync N80 Ended” sticky yes description ¬
“Sync ended @ ” & lastdate application name “MySyncNow”
end tell