|
Forum List
>
Café LA
>
Topic
OT: The successor of render beepPosted by Andreas Kiel
Some people asked me how to do the "render beep" a little bit better and send an SMS.
Here it is. But you need "BluePhoneElite" (I think you need it anyway). property windowList : {} my getSequenceName() --my renderSelection() -- use this to render selection (means remove the "--" at this beginning of the paragraph and insert "--" at the beginning of the next one) my renderAll() -- use this to render all (means remove the "--" at the beginning of this paragraph and insert "--" at the beginning of the previous one) my watchFCP() set timeFinished to (do shell script "date '+%y%m%d%H%M%S'" as string -- y = year, m = month, d = day, H = hour, m = minute, s = second set theName to "Andreas Kiel" as string -- please change the name to a name matching the one (in your address book) you want to send the message. my sendSMS(timeFinished, theName) on sendSMS(timeFinished, theName) activate application "BluePhoneElite" tell application "System Events" tell process "BluePhoneElite" click button "New" of tool bar 1 of window "SMS Center" select combo box 1 of splitter group 1 of splitter group 1 of window "SMS Center" keystroke theName delay 2 -- to get the name found keystroke tab -- to step to the message keystroke "Hi " & theName & ", your FCP rendering has been finished or canceled at: " & timeFinished & "." -- you can't use any line feed or return in this text delay 2 -- to get the keystroke finished click button "Send" of list 1 of splitter group 1 of splitter group 1 of window "SMS Center" end tell end tell end sendSMS on getSequenceName() try tell application "Final Cut Pro" activate end tell tell application "System Events" tell application process "Final Cut Pro" set windowList to get name of every window -- find the timeline repeat with w from 1 to (count of windowList) set wName to item w of windowList if wName contains "Timeline" then set seqWindow to window wName tell seqWindow -- bring the time line to front perform action "AXRaise" end tell exit repeat end if end repeat end tell end tell end try end getSequenceName on renderSelection() try tell application "System Events" tell application process "Final Cut Pro" click menu item 1 of menu 1 of menu item 1 of menu 1 of menu bar item 8 of menu bar 1 end tell end tell end try end renderSelection on renderAll() try tell application "System Events" tell application process "Final Cut Pro" click menu item 1 of menu 1 of menu item 2 of menu 1 of menu bar item 8 of menu bar 1 end tell end tell end try end renderAll on watchFCP() set windowList1 to {} repeat while ((not windowList = windowList1)) tell application "System Events" tell application process "Final Cut Pro" set windowList1 to get name of every window end tell end tell end repeat return windowList1 end watchFCP Have fun Andreas
Hi Jude,
BluePhoneElite is something cool if you hate to type SMS on a tiny phone. It can be found here: [mirasoftware.com]. I bought a cheap used cell phone with BlueTooth (40 USD) and a cheap german prepaid card (currently 1.3 - 15 cent per SMS depending where you send it). So the cell phone hangs around somewhere in the office connect to the charger. So it's some investment needed, but if I've to render some more intense stuff I always (take my MacBook) and leave the office not to get nervous or I go home or out for dinner. In booth cases I'll get my notification some time and I can decide whether it makes sense to go back to the office or have some fun for the rest of the night. And it's always some kind of cool to tell the friends in the restaurant or bar "My computer just sent me a SMS which says I've earned some money". The code is some kind of toy, but brings some additional fun into life. You can even combine this script with the "Compressor" script I posted some time ago to send the the rendered stuff somewhere. As said -- have fun Andreas
So could this script potentially use the Apple Address Book SMS feature instead of the BluPhoneElite app?
Potentially you could also use the Skype Address Book plugin 'Send SMS with Skype' which means no need for the extra mobile phone and keeps it all software based and probably cheaper too since Skype SMS is very cheap. edit: perhaps this is useful for the Skype route
I would love to use Skype as well - BUT the "Send SMS" button in Skype can't be accessed by Apple's GUI scripting. So I can prepare an SMS with Skype but can't send it. Send a feature request to the Skype team, maybe the more people do it it will help to make it work. Andreas
Just found out a "dirty hack" to use Skype
on sendSkypeCall(internationalPhoneNumber) tell application "Skype" activate end tell tell application "System Events" tell application process "Skype" click menu item "Call Phones..." of menu 1 of menu bar item "Call" of menu bar 1 tell window "Call ordinary phones or send SMS" tell menu button 1 perform action "AXPress" click menu item "Select Country or Region" of menu 1 end tell delay 1 / 2 keystroke phoneNumber delay 1 -- to finish typing keystroke return end tell end tell end tell end sendSkypeCall Replace the set timeFinished to (do shell script "date '+%y%m%d%H%M%S'" as string -- y = year, m = month, d = day, H = hour, m = minute, s = second set theName to "Andreas Kiel" as string -- please change the name to a name matching the one (in your address book) you want to send the message. my sendSMS(timeFinished, theName) by my sendSkypeCall(internationalPhoneNumber)The internationalPhoneNumber is your phone number including country code. Then Skype will give you a call and if nobody answers you know it was FCP calling you Andreas
Cool. Using this process, could you do the same up to the part where you open the 'Call Phones' window, enter the phone number and then go to the Contacts menu and select SMS.
This takes the number from the Call Phones window so you can enter text. Not sure if you can GUI script the Send SMS button though (edit: this is possible using CTRL and TAB) EDIT: In very simple terms, something like this. tell application "Skype" activate end tell tell application "System Events" tell application process "Skype" click menu item "Call Phones..." of menu 1 of menu bar item "Call" of menu bar 1 delay 1 keystroke "xxxxxxxxxx" -- without the 0 and assuming country code is correctly set in Skype delay 1 -- to finish typing click menu item "Send SMS..." of menu 1 of menu bar item "Contacts" of menu bar 1 delay 1 keystroke "Your FCP render is done!" delay 1 keystroke tab using control keystroke return end tell end tell end
keystroke tab using control keystroke return Very cool Mark - I looked for that since some time and didn't know this short cut. International phone number should be +1 for US (or any matching number) city code phone number. The bad thing with the preset is that you might have called somebody somewhere in the world and Skype does remember that country code. So the better option is to use the tell menu button 1 perform action "AXPress" click menu item "Select Country or Region" of menu 1 end tellto get rid of any stored country code and use +country code,city code, phone number. I'll post a complete one later. Andreas
Hi Andreas,
It does work for me. I've used the simple script above to send an autoSMS to my mobile and it sends using that CTRL + TAB command. I worked on the assumption that you could TAB to the send SMS button. Initially I found that if you just use TAB it goes through the Toolbar items, but I thought CTRL + TAB would go backwards and pick up the Send SMS button. Looking a little closer, CTRL + TAB actually goes to the first Toolbar icon too, but pressing enter still send the SMS. I see now that even just using normal TAB forward, and pressing enter also sends the SMS. Its seems, as long as the Text entry field is not selected, then pressing enter will send the SMS what ever is selected. I'm using Skype 2.6.0.151 (latest I think). So the CTRL is not needed, just one TAB onto something else in the window. Mark
Hi all,
Here the new skype version property windowList : {} my getSequenceName() my renderSelection() -- use this to render selection (means remove the "--" at this beginning of the paragraph and insert "--" at the beginning of the next one) --my renderAll() -- use this to render all (means remove the "--" at the beginning of this paragraph and insert "--" at the beginning of the previous one) my watchFCP() my sendSkypeCall("+491636383326", "Your render is done" -- Example: +1415123456 (+1 = country code, 415 = city code, 123456 = phone) on sendSkypeCall(internationalPhoneNumber, theText) tell application "Skype" activate end tell tell application "System Events" tell application process "Skype" set theTarget to "skype:" & internationalPhoneNumber & "?sms" open location theTarget keystroke theText delay 2 -- depending on the length of the message you may modify the time keystroke tab using shift keystroke return end tell end tell end sendSkypeCall on getSequenceName() try tell application "Final Cut Pro" activate end tell tell application "System Events" tell application process "Final Cut Pro" set windowList to get name of every window -- find the timeline repeat with w from 1 to (count of windowList) set wName to item w of windowList if wName contains "Timeline" then set seqWindow to window wName tell seqWindow -- bring the time line to front perform action "AXRaise" end tell exit repeat end if end repeat end tell end tell end try end getSequenceName on renderSelection() try tell application "System Events" tell application process "Final Cut Pro" click menu item 1 of menu 1 of menu item 1 of menu 1 of menu bar item 8 of menu bar 1 end tell end tell end try end renderSelection on renderAll() try tell application "System Events" tell application process "Final Cut Pro" click menu item 1 of menu 1 of menu item 2 of menu 1 of menu bar item 8 of menu bar 1 end tell end tell end try end renderAll on watchFCP() set windowList1 to {} repeat while ((not windowList = windowList1)) tell application "System Events" tell application process "Final Cut Pro" try set windowList1 to get name of every window end try end tell end tell end repeat return windowList1 end watchFCP To make this work you have to have to go "system preferences -> keyboard & mouse -> keyboard shortcuts" and then set the "full keyboard access" at the bottum to "all controls" Again thanks Mark to figure out that tricky stuff and spending the time to talk late night. I'll try to find a way to change system prefs the way that the above is done automatically (some time this week). For all others: have fun and enjoy your personal "end of render message" Andreas
Sorry, only registered users may post in this forum.
|
|