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
How do I get my Australian ipad to work in Sth Korea? I'm in Jinju - went to the Apple desk at the Galleria, but they said I had to go to SK Telecom. I went to a small branch near my apt, and they said to go to a grocery store. I think I lost somethi [More]
Macbook Pro 10.6.7 Tried to download 4.0 - it is incompleteHello, discodiva64 Thank you for the question.  Try uninstalling all components of iTunes in the order specified of the article below.  Once this is done attempt to install iTunes again. Remo [More]
my phone is locked and is asking for a 4digit code.  I have not idea what that would be.  I have entered every thing I can thing of  and nothing works.  Please help.If you are unable to remember your code you will need to restore the iPhone.  Take a [More]
I recently upgraded my Thunderbird client to 3.1.10 from 2.2xx and I no longer can see the size of folders or how many messages are in certain folders. The folders do show how many are unread, but not the total messages or size of data in folder as I [More]
Dear all, I'm having trouble getting the system property user.name (which we need in our ant scripts) on our CentOS box. :( When running the program below thru java dumpproperties2 it prints "user.name='?'" on our CentOS 4.3. On win32 it works. [More]
Hello, I have installed iTune on my PC. Since then I can no longer use the standard MSW picture viewer. This one allows me to rotate and resize pictures, and I cannot do this with QT. How can I get back ? I tried to use the "External module managemen [More]
I'm trying to divide a list of data into a table of 5 rows, and as many columns as needed to hold the list of data. Here is the getColumnCount method of the TableModel:         public int getColumnCount() {             System.out.println("abilities.s [More]
I know how to filter inside the contacts (disabling linkedin, twitter etc) but that list doesn't when you are composing messages, making phones calls etc. For Example, you can have all your social media pps turned off for contacts (Contacts -> Settin [More]
Just installed Safari on my pc and man its nothing close to what apple said it should be, would love to call it slow but that would leave you thinking its faster than it actually is. I know the answer is buy a mac but cant even begin to afford one, m [More]
I am trying to convert my power point to PDF using Arobat Pro XI. On the 6th page of the pdf the pages are shifted down and to the left. I can Select all and drag them up but when I do this part of the table that was created in power point is still m [More]