Sitemap

Amicuk Programming Answers

Need help converting old Applescript for Snow Leopard

-0001-11-30   Views:0

Advertisement

Ok, so I've downloaded the app "PowerHour" for mac. It needs to use the date function which is different in Snow Leopard, so I've heard. I don't program in Apple Script so I can't figure out what syntax to use. Can anyone help me fix this code b

Ok, so I've downloaded the app "PowerHour" for mac. It needs to use the date function which is different in Snow Leopard, so I've heard. I don't program in Apple Script so I can't figure out what syntax to use. Can anyone help me fix this code below?
I'm trying to code this because I don't think the original developer has any hand in this program anymore.
The app on macupdate: http://www.macupdate.com/app/mac/24107/power-hour
Here's the part that is giving the errors:
set gameLengthAsDate to (date (zeroTime)) + (enteredMinutes * minutes)
set songLengthAsDate to date (songLength)
set gameStart to current date
set songStart to gameStart
set gameEnd to gameStart + (time of gameLengthAsDate)
set songEnd to songStart + (time of songLengthAsDate)

The replay answer
Advertisement
AppleScript in Snow Leopard is a bit pickier about specifying dates. From the AppleScript Release Notes, "the [date] string must exactly match one of the system date formats".
It looks like the script is using a shortcut to set the time of the current date. I didn't test a modified application (just that the script statements set a valid date), but you might give the following a try:
1) change the following properties (declared at the beginning of the script)property zeroTime : 0
property songLength : 60
2) change the statements that set the time toset gameLengthAsDate to (current date)
set time of gameLengthAsDate to zeroTime + (enteredMinutes * minutes)
set songLengthAsDate to (current date)
set time of songLengthAsDate to songLength

Go to See the other 7 answers

Need help converting old Applescript for Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

Ok, so I've downloaded the app "PowerHour" for mac. It needs to use the date function which is different in Snow Leopard, so I've heard. I don't program in Apple Script so I can't figure out what syntax to use. Can anyone help me fix this code b[More]

Applescript and Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

I don't know if I'm alone in thinking this, but Applescript support in Snow Leopard seems to have gone a bit off the rails. I'm experiencing random crashes when doing (choose file) and the user uses the search box that now shows in order to find a fi[More]

Converting from excel 2004 to ical with Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

tried to import data via iCalMaker but was informed by the software maker that they don t support Snow Leopard. So ... a bit lost. I have the custom of preparing data in Excel, and would want to import some data into iCal. However I cannot find a goo[More]

AppleScript Studio projects under Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

I know Apple has depreciated AppleScript Studio, but the documents say old projects can still be used, so I assume there's a way to edit my old AS projects. I have the iPhone SDK with Xcode 3.2 and Interface Builder, but it doesn't recognize my AS pr[More]

ICal AppleScript translation to Snow Leopard

Category:DefaultRelease time:2015-10-11Views:130

(I didn't see an AppleScript section, so if this is posted in the wrong section, I apologize.) I use Event2ToDo (an AppleScript function) to create ToDos in iCal on a daily basis. It is a very helpful tool, and I really want to keep using it. That be[More]

File path applescript broken after snow leopard

Category:DefaultRelease time:2015-10-11Views:130

I was using this script in illustrator cs4 on a mac running 10.5 and all was good tell application "Adobe Illustrator" activate set theName to name of current document set theNamecount to count of theName set thePath to the file path of current[More]

PDF converter for Mac Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

What would be the best PDF-converter for my Mac OSX 10.6.4 Snow Leopard? Thanks for advice. VallisWell, I think actually you can try this *PDF converter*. It could convert PDF to Word, PowerPoint, Excel, Epub and 2 other format. Extremely easy to use[More]

Problems with AppleScript Editor.app in Snow Leopard

Category:DefaultRelease time:-0001-11-30Views:130

I have been using the Satimage.osax scripting addition with Script Editor.app in Leopard without problem. After I upgraded to Snow Leopard, the Script Editor.app was replaced by AppleScript Editor.app in which the following one-line script change ",&[More]

AppleScript for address book stopped working in snow leopard

Category:DefaultRelease time:-0001-11-30Views:130

I had an AppleScript stop working after upgrade to snow leopard. I select an address and it moves it to a group "envelopes" then prints the address in my current document. Later, I make a mail merge document of "envelopes and print out the[More]

Can anyone help me find the raw converter for Nikon D4/ I have Aperture 3.0 with Snow Leopard. thanks in advance

Category:DefaultRelease time:-0001-11-30Views:130

hi, Having problems finding the correct download for a Nikon D4 raw converter. Can anyone help direct me to the right link? I am using Aperture 3.0 with Snow leopard. thanks in advance MarkNikon D4 is supported by Digital Camera RAW Compatibility Upd[More]

Convert a Mac Pro Server from January 2007 with OS 10.4 Server to Snow Leopard 6.0 (NON SERVER)

Category:DefaultRelease time:-0001-11-30Views:130

I have a Mac Pro Server from January 2007 with OS 10.4 Server installed. I want to convert from OS 10 Server OS to just using Snow Leopard 6.0 (NON SERVER). I have two hard drives installed. What is the best way to do this? Can I just install Snow Le[More]

Hot
I followed the manaul ".show_modal" method in this thread: open Skillbuilders modal page from report My question ishow do I refresh the parent when the modal closes?svk1965 wrote: I followed the manaul ".show_modal" method in this thre [More]
I keep my Macbook up to date by checking regularly via software update, so far with no mishaps, but I have seen people on these forums mentioning that a it is better to download the combo updates direct from Apples website. Is this true, if so why, a [More]
My question is if you can change the format of how shortened file names appear in folders. The default is showing the beginning and ending of a file name: "summer vacation photos" -> "summ...otos" (of course depending on how large t [More]
Hi everybody I'm thinking about buying a T400 to replace my old T41. Comparing the features for the laptop, I've seen the native resolution for the T400 is 1440x900 while for my current laptop is 1024x768. In case of buying the new machine, I'd be us [More]
keep trying to upgrade my iphone 4 after sync.  keep getting -23 error. whats next?does it says anything else than unknow error? try going to settings>store, click on apple id and then sign out. Restart iphone and sign back in and try downloading aga [More]
how do i revert the order of still images in imovie 09???Question asked and answered many times ! Yvan KOENIG (VALLAURIS, France) jeudi 19 janvier 2012 iMac 21"5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2 My Box account  is : http: [More]
Hi all, We have had a number of BPM processes running successfully in our XI 3.0 DEV SP17 system for weeks now but suddenly, none are now working. Our BPMs wait a specified amount of time before creating a bundled outbound message. In SXMB_MONI, the [More]
got message saying firefox must closed to proseed with insallation please close firefox to continue#close Firefox with File > Exit or "Firefox" button > Exit. Give Firefox some time to close and check that it finished via Windows 7 shortcu [More]
Last night I started up my 2010 17" macbook pro and I noticed the startup was strange. The gray screen looked different and the apple had a dotted line outline. When my desktop appeared the image looked like I used a polarized affect in Photoshop. I [More]
Hi all, I am looking for the way to pass to the bapi in object the Header Texts for Purchase Requisition. Did anyone else have my same problem? Do you have any suggest for me? Thanks RegardsHi, You can use FM SAVE_TEXT to save PR's header text after [More]