• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
tell application - without the app's name?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tell application - without the app's name?


  • Subject: tell application - without the app's name?
  • From: garybi <email@hidden>
  • Date: Tue, 04 Mar 2003 09:26:51 +0000

Hi, just wondered if anyone had an idea getting around this problem?

l'm trying to make my scripts auto update from a unix server - the idea is that the applescript is saved on the server as a text file and you have a launcher on your desktop that ftp's the text file from the server and then just a 'run script file (filename)' to execute this updated text file. The Desktop mac's are also running OS9.

My problem is that if l have some tell application "whatever" in the text file that run's and it pop's up a message box asking me to point to the applications... which l don't want.. l can't hard code paths as the apps are sometimes in different places or under a different name/version.

I did find something on the net that said you can use the file id to get the apps Path & Name which does work:

e.g:

================

set QuarkPage to "HD Black:Desktop Folder:testpage"

try
tell application "Finder"
set appPath to application file id "XPR3" as string
set appName to name of application file id "XPR3" as string
end tell

launch application appName

on error errMsg
display dialog (errMsg) as string
end try

===================

Works great - Quark or whatever file id you enter open's.

The problem is that if l try and do any Quark commands the script will not pass Check Syntax. ;-(
I guess that's because it's not looking at Quark's dictionary.

eg:

1) - This works fine
================

set QuarkPage to "HD Black:Desktop Folder:testpage"

try
tell application "Finder"
set appPath to application file id "XPR3" as string
set appName to name of application file id "XPR3" as string
end tell

launch application appName

-- this opens the page fine
tell application appName
open QuarkPage
end tell

on error errMsg
display dialog (errMsg) as string
end try

===================

2) - syntax wrong as l'm using 'use doc prefs yes' thats in Quark's Dict
================

set QuarkPage to "HD Black:Desktop Folder:testpage"

try
tell application "Finder"
set appPath to application file id "XPR3" as string
set appName to name of application file id "XPR3" as string
end tell

launch application appName

-- syntax wrong as l'm using 'use doc prefs yes' thats in Quark's Dict
tell application appName
open QuarkPage use doc prefs yes
end tell

on error errMsg
display dialog (errMsg) as string
end try

===================

I did find something about using raw events (the app needs to be loaded first) - eg:

=============
set QuarkPage to "HD Black:Desktop Folder:testpage"

try
set creaType to "XPR3"
tell application "FInder" to the first process whose creator type is (creaType as type class)
set appName to the result as <<class psn >>

tell appName to open QuarkPage

on error errMsg
display dialog (errMsg) as string
end try
==============

If this is the only way to get it to work - how do l find the raw events list from the Quark Dictionary?


Regards, Gary.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: tell application - without the app's name?
      • From: Emmanuel <email@hidden>
  • Prev by Date: Howto authenticate SOAP calls with AS?
  • Next by Date: Re: myLoop: getting subject of messages in Mail.app
  • Previous by thread: Howto authenticate SOAP calls with AS?
  • Next by thread: Re: tell application - without the app's name?
  • Index(es):
    • Date
    • Thread