DTP


 
Lively discussions on the graphic arts and publishing — in print or on the web


Go Back   Desktop Publishing Forum > General Discussions > Print Production & Automation

Reply
 
Thread Tools Display Modes
Old 05-20-2005, 05:48 AM   #1
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default Mac scripting problem seeks solution

A friend uses the last beta version of Fontographer (as do I, so I have an interest in this). It runs only in Classic, and is time-bombed to stop working at a certain, long past, date. So to run it, the user needs to set the clock back, launch the application, then restore the accurate date.

Is there a way to do this with AppleScript (or another scripting language — JavaScript, maybe)?

Here is my friend’s question:
Quote:
Can someone tell me exactly how to do the simplest thing?

I want a script that when I press the button, it will

1. Set the date back to Jan 15, 1997
2. Execute Fog 5 beta 2
3. Set the date back to 'auto'.
Is there any hope? If so, tips and advice welcome.

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 05-20-2005, 03:49 PM   #2
djb
Member
 
djb's Avatar
 
Join Date: Feb 2005
Location: Saskatoon, Saskatchewan
Posts: 492
Default

Quote:
Originally Posted by ktinkel
A friend uses the last beta version of Fontographer (as do I, so I have an interest in this). It runs only in Classic, and is time-bombed to stop working at a certain, long past, date. So to run it, the user needs to set the clock back, launch the application, then restore the accurate date.
Is there a way to do this with AppleScript (or another scripting language — JavaScript, maybe)?
I can think of a couple of approaches in Applescript, neither of them particularly graceful... Not that it matters in a script.

I'm kind of hoping Shane jumps in shortly, but if he doesn't I'll try and sketch out something.

Are they booted into OS X or OS 9? What version? Do they have administrator privileges on the Mac?
djb is offline   Reply With Quote
Old 05-20-2005, 05:18 PM   #3
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default

Quote:
Originally Posted by djb
I can think of a couple of approaches in Applescript, neither of them particularly graceful... Not that it matters in a script.

I'm kind of hoping Shane jumps in shortly, but if he doesn't I'll try and sketch out something.

Are they booted into OS X or OS 9? What version? Do they have administrator privileges on the Mac?
It is just a guy — he has OS X and Classic (not sure whether he also has a machine running OS 9). He certainly has admin privileges (there’s no one else there!)

Thanks for any help you can provide.

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 05-20-2005, 06:50 PM   #4
djb
Member
 
djb's Avatar
 
Join Date: Feb 2005
Location: Saskatoon, Saskatchewan
Posts: 492
Default

What version of OS X? It's important to know. One of the options I can envision involves GUI scripting.
djb is offline   Reply With Quote
Old 05-20-2005, 07:07 PM   #5
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default

Quote:
Originally Posted by djb
What version of OS X? It's important to know. One of the options I can envision involves GUI scripting.
I will have to ask. He may be way back on 10.3.4.

Thanks.

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 05-20-2005, 08:29 PM   #6
Shane Stanley
Staff
 
Join Date: Oct 2004
Location: Melbourne, Australia
Posts: 526
Default

This is pretty quick-and-dirty:

-- set these to whatever you want
set newDay to "01"
set newMonth to "01"
set newYear to "2001"
-- get time/date now
set timeNow to do shell script "date -u '+%m%d%H%M%C%y'"
-- set new date
set newdate to newMonth & newDay & (text 5 thru 8 of timeNow) & newYear
do shell script "date -u " & newdate with administrator privileges
-- open app
try
tell application "The App"
activate
end tell
end try
-- reset date
do shell script "date " & timeNow with administrator privileges

Put in the name of the real app where it says TheApp, paste it onto a Script Editor window, and save it as an application. The Mac will lose up to a minute each time it's run, but that shouldn't be a big deal.

Shane
Shane Stanley is offline   Reply With Quote
Old 05-20-2005, 08:32 PM   #7
djb
Member
 
djb's Avatar
 
Join Date: Feb 2005
Location: Saskatoon, Saskatchewan
Posts: 492
Default

Quote:
Originally Posted by Shane Stanley
This is pretty quick-and-dirty:
Ahhh... The master himself at work.

Nothing wrong with Q&D, sirrah.
djb is offline   Reply With Quote
Old 05-21-2005, 04:37 AM   #8
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default

Quote:
Originally Posted by djb
What version of OS X? It's important to know. One of the options I can envision involves GUI scripting.
Okay. He is on 10.3.8, is thinking of moving to 10.3.9, and says he may shortly move to Tiger.

He is so interested in being able to control this clock-setback thing, though, that that might influence his decision (and I know he once started over, went all the way back to an early version of Panther — and I bet he’d be willing to do that again if it means he can have a script that works).

Thanks for your help.

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 05-21-2005, 05:08 AM   #9
ktinkel
Founding Sysop
 
ktinkel's Avatar
 
Join Date: Oct 2004
Location: In Connecticut, on the Housatonic River near its mouth at Long Island Sound.
Posts: 11,189
Default

Quote:
Originally Posted by Shane Stanley
This is pretty quick-and-dirty:

-- set these to whatever you want
set newDay to "01"
set newMonth to "01"
set newYear to "2001"
-- get time/date now
set timeNow to do shell script "date -u '+%m%d%H%M%C%y'"
-- set new date
set newdate to newMonth & newDay & (text 5 thru 8 of timeNow) & newYear
do shell script "date -u " & newdate with administrator privileges
-- open app
try
tell application "The App"
activate
end tell
end try
-- reset date
do shell script "date " & timeNow with administrator privileges

Put in the name of the real app where it says TheApp, paste it onto a Script Editor window, and save it as an application. The Mac will lose up to a minute each time it's run, but that shouldn't be a big deal.

Shane
Thanks, Shane! that’s fabulous!

I sent it to my friend. It looks a little confusing to me (assuming the lines that begin with -- are comments?) but let’s see how it goes for him. (Not sure if he has ever done any scripting, but he is generally smart about computer stuff.)

   
__________________
[SIZE=2][COLOR=LemonChiffon]::[/COLOR][/SIZE]
[SIGPIC][/SIGPIC]
ktinkel is offline   Reply With Quote
Old 05-21-2005, 08:29 AM   #10
djb
Member
 
djb's Avatar
 
Join Date: Feb 2005
Location: Saskatoon, Saskatchewan
Posts: 492
Default

If he's on Pather, and looking to go to Tiger, he's fine. Let us know how Shane's script works.
djb is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Colorization Solution Andrew B. Images 24 01-08-2007 02:47 PM
External storage - my solution iamback General Publishing Topics 12 03-14-2006 01:43 PM
Santa America seeks your help ilox The Corner Pub 3 12-02-2005 05:59 AM
indesign cs2 scripting tutorial. krav13 Print Production & Automation 1 11-23-2005 11:18 AM
Corel Seeks Beta Testers for Draw Suite Andrew B. Software 1 07-19-2005 12:52 PM


All times are GMT -8. The time now is 11:47 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Contents copyright 2004–2014 Desktop Publishing Forum and its members.