Re: Opening documents in App via Finder?
Re: Opening documents in App via Finder?
- Subject: Re: Opening documents in App via Finder?
- From: Michael <email@hidden>
- Date: Fri, 24 Aug 2007 12:05:42 -0700
- Thread-topic: Opening documents in App via Finder?
Hi:
This form works:
set openFP to ((path to desktop folder) as text) & "Human_Genomes.fp5"
set OpenerAppFP to ((path to applications folder) as text) & "FileMaker Pro
6 Folder:" & "FileMaker Pro.app"
tell application "Finder"
open file openFP using file OpenerAppFP
end tell
I think the key is adding ".app" to your app's Finder name.
(This worked while FileMaker Pro 9 was also running.)
m
On 8/24/07 12:00 PM, "email@hidden"
<email@hidden> wrote:
> Send AppleScript-Users mailing list submissions to
> email@hidden
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.apple.com/mailman/listinfo/applescript-users
> or, via email, send a message with subject or body 'help' to
> email@hidden
>
> You can reach the person managing the list at
> email@hidden
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AppleScript-Users digest..."
>
>
> Today's Topics:
>
> 1. Re: Problem installing ImageMagick (Chris Swain)
> 2. Re: Problem installing ImageMagick (Fleisher, Ken)
> 3. Re: Reading and writing records (Luther Fuller)
> 4. Re: Problem installing ImageMagick (Fleisher, Ken)
> 5. AppleScript/Automator Help (Jeffrey Talbot)
> 6. Re: Problem installing ImageMagick (Fleisher, Ken)
> 7. Re: Reading and writing records (has)
> 8. Re: Reading and writing records (Gary (Lists))
> 9. Converting AppleScript Routine to shell, how to write BOM to
> beginning of file? (Richard R ? nnb ? ck)
> 10. Re: Reading and writing records (Luther Fuller)
> 11. Re: Opening documents in App via Finder? (Joe)
> 12. getting duplicates in a list by item id (Patrik B.)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 24 Aug 2007 15:31:06 +0100
> From: Chris Swain <email@hidden>
> Subject: Re: Problem installing ImageMagick
> To: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="us-ascii"
>
>
> On 24 Aug 2007, at 15:26, email@hidden
> wrote:
>
>> Problem installing ImageMagick
>
>
> You might want to have a look at this.
>
> http://blog.econtentpark.com/permalinks/2007/07/11/Installing-
> ImageMagick-on-MacOS-X/
>
> Chris
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.apple.com/mailman/private/applescript-users/attachments/20070824/
> 3ff0cc0d/attachment.html
>
> ------------------------------
>
> Message: 2
> Date: Fri, 24 Aug 2007 10:37:49 -0400
> From: "Fleisher, Ken" <email@hidden>
> Subject: Re: Problem installing ImageMagick
> To: Chris Swain <email@hidden>, Applescript Users
> <email@hidden>
> Message-ID: <C2F4657D.3235%email@hidden>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Thanks for the link. I didn¹t install it in the usr directory. Does it have
> to be exactly there? I put it in ³$HOME/Library/ImageMagick-6.3.5/² and
> didn¹t move it after that. I thought that all of the links would work
> correctly after that as long as I used the full path each time. (I¹m not
> very savvy at this Unix stuff...)
>
>
> On 8/24/07 10:31 AM, "Chris Swain" <email@hidden> wrote:
>
>>
>> On 24 Aug 2007, at 15:26, email@hidden wrote:
>>
>>>
>>> Problem installing ImageMagick
>>>
>>
>>
>> You might want to have a look at this.
>>
>>
http://blog.econtentpark.com/permalinks/2007/07/11/Installing-ImageMagick-on->>
M
>> acOS-X/
>>
>> Chris
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> AppleScript-Users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> Archives: http://lists.apple.com/archives/applescript-users
>>
>> This email sent to email@hidden
>
>
>
> --
> Ken Fleisher
>
> Photographer
> Imaging & Visual Services
> National Gallery of Art
> Washington, D.C.
>
> Phone: (202) 712-7471
> email@hidden
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.apple.com/mailman/private/applescript-users/attachments/20070824/
> e66a7110/attachment.html
>
> ------------------------------
>
> Message: 3
> Date: Fri, 24 Aug 2007 09:45:08 -0500
> From: Luther Fuller <email@hidden>
> Subject: Re: Reading and writing records
> To: AS users <email@hidden>
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> On Aug 24, 2007, at 8:34 AM, Chris wrote:
>> Luther Fuller wrote:
>>> On Aug 24, 2007, at 7:33 AM, Chris wrote:
>>>> I know how to read and write a list of records to a file using
>>>> the "as list" qualifier.
>>>>
>>>> But I've been unable to discover the right incarnation to read
>>>> and write one record at a time.
>>>> Is this possible? Does anyone have a code snippet for writing a
>>>> list of records one at a time
>>>> and reading them back one at a time until eof?
>>>
>>> I'm curious. What kind of file?
>>> I read and write records from/to a file, but it's a .plist (xml)
>>> file.
>>> Easy to do with System Events. The files are preference files,
>>> info.plist files within an application bundle, &c.
>>> If you need to read/write some data, especially if it's already
>>> organized into records, this works very well.
>>>
>>
>> If you have a code snippet I'd be interested.
>
> A Quick Tutorial ...
>
> You will need a copy of "Property List Editor" to read the files you
> create. It's in Developer Tools.
>
> AVOID all knowledge about XML. You don't need it. It adds confusion.
> When you open a .plist file with Property List Editor AVOID any use
> of the Dump button. It shows you the XML and adds to the confusion.
>
> There is no command in System Events to create a new .plist file. You
> have to create an empty or default .plist file and store it in your
> application bundle's /Contents/Resources/ folder. When you need a
> new .plist file copy and rename this file as necessary.
>
> Reading ---------------
> -- fileAlias is an alias to the .plist file
> tell application "System Events"
> set filePath to (POSIX path of fileAlias)
> set fileRecord to (value of property list file filePath)
> end tell
>
> 'fileRecord' is now a record whose value is the root record of the
> file. The entire file, in other words.
>
> You can also read a single key from a .plist file, provided you know
> it exists. For example ...
> tell application "System Events"
> POSIX path of fileAlias
> value of property list item "someKey" of property list file the result
> end tell
>
> The result can be a String, Dictionary, Array, Number, Boolean, Date,
> Data.
> (where String = Unicode Text, Dictionary = Record, Array = List)
>
> Writing ---------------
> You can write the entire contents of the .plist file ...
> tell application "System Events"
> set filePath to (POSIX path of fileAlias)
> set (value of property list file filePath) to fileRecord
> end tell
>
> or you can write the value of single key, if it exists ...
> tell application "System Events"
> POSIX path of fileAlias
> set (value of property list item "someKey" of property list file
> the result) to someValue
> end tell
>
> Modifying ---------------
> When you read a .plist file into the record 'fileRecord', you may
> want to write it back to the file after modifying or updating it. For
> example ...
>
> set fileRecord to {|newKey|: newValue} & fileRecord & {|defaultKey|:
> defaultValue}
>
> 1. fileRecord may or may not have had a 'newKey', but it now does
> have a 'newKey' which has value 'newValue'.
> 2. If fileRecord did not have a 'defaultKey', it now does have a
> 'defaultKey' and it value is 'defaultValue', but if fileRecord did
> have a 'defaultKey', it retains its original value.
> 3. Using || around key names avoids conflict with variable names in
> your AppleScript code.
>
> Perhaps I could say more. Or not.
>
>
>
> ------------------------------
>
> Message: 4
> Date: Fri, 24 Aug 2007 10:48:14 -0400
> From: "Fleisher, Ken" <email@hidden>
> Subject: Re: Problem installing ImageMagick
> To: Chris Swain <email@hidden>, <email@hidden>
> Message-ID: <C2F467EE.3238%email@hidden>
> Content-Type: text/plain; charset="us-ascii"
>
> Okay, I tried it again using exactly the directories that are used in the
> blog. When I tried the mv command, I got a permissions denied. When I looked
> at man mv there was nothing about adding a password. How do I move the
> directory?
>
> Thanks.
>
>
> On 8/24/07 10:31 AM, "Chris Swain" <email@hidden> wrote:
>
>>
>> On 24 Aug 2007, at 15:26, email@hidden wrote:
>>
>>>
>>> Problem installing ImageMagick
>>>
>>
>>
>> You might want to have a look at this.
>>
>>
http://blog.econtentpark.com/permalinks/2007/07/11/Installing-ImageMagick-on->>
M
>> acOS-X/
>>
>> Chris
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> AppleScript-Users mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> Archives: http://lists.apple.com/archives/applescript-users
>>
>> This email sent to email@hidden
>
>
>
> --
> Ken Fleisher
>
> Photographer
> Imaging & Visual Services
> National Gallery of Art
> Washington, D.C.
>
> Phone: (202) 712-7471
> email@hidden
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.apple.com/mailman/private/applescript-users/attachments/20070824/
> a80e17e0/attachment.html
>
> ------------------------------
>
> Message: 5
> Date: Fri, 24 Aug 2007 09:59:10 -0500
> From: Jeffrey Talbot <email@hidden>
> Subject: AppleScript/Automator Help
> To: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> Hey folks.
>
> I'm looking for some assistance with an Applescript. This seem
> relatively easy, but I'm not well versed in writing scripts, and even
> though I've searched online, I haven't been abel to find what I need.
>
> This script will be the building block of a much larger Automator
> process, and that part seems pretty cut and dry for me.
>
> Basically, I'm producing radio spots, putting them on a server, and
> allowing stations to log in to download the spots when they are
> ready. Each station has their own "home" folder, which has only spots
> they are to air. There are lots of spots, there are lots of
> stations and there will be lots of advertisers. Not all spots will go
> to all stations not all advertisers will buy all stations, so it gets
> complex pretty quick.
>
>
> The building block I'm after is a script that when activated, can
> look at the contents of a folder and:
>
> 1. If there are no new files, do nothing
> 2. If there are files that have been deleted, do nothing
> 3. if there are files that have been added, create an email to a
> particular email address, add some boilerplate copy and include a
> list of the "new" files.
>
> I'm pretty sure I'd be able to duplicate and customize this script
> for the different stations, changing the mail to address and the copy
> as needed.
>
>
> That's really it.
>
> I"m assuming the script will have to have a text file to compare
> contents with, and that text file can be stored in the same folder
> the script is monitoring. It would be great if text file were
> invisible, but that doesn't matter in the long run. I'm also
> guessing one of the last steps will be the script will be to re-write
> the text file with the current contents of the folder, so the next
> time the script is run, it'll have a valid file list to compare for
> the next pass.
>
>
> With this building block, the plan is to customize them for lots of
> different stations, then chain them together for a single advertiser
> using Automator.
>
> Any help would be greatly appreciated.
>
> JT
>
>
> ------------------------------
>
> Message: 6
> Date: Fri, 24 Aug 2007 11:09:21 -0400
> From: "Fleisher, Ken" <email@hidden>
> Subject: Re: Problem installing ImageMagick
> To: Applescript Users <email@hidden>
> Message-ID: <C2F46CE1.3240%email@hidden>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Okay, thanks everyone. I¹ve got it running now...
>
> --
> Ken Fleisher
>
> Photographer
> Imaging & Visual Services
> National Gallery of Art
> Washington, D.C.
>
> Phone: (202) 712-7471
> email@hidden
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.apple.com/mailman/private/applescript-users/attachments/20070824/
> 478f92b4/attachment.html
>
> ------------------------------
>
> Message: 7
> Date: Fri, 24 Aug 2007 16:35:48 +0100
> From: has <email@hidden>
> Subject: Re: Reading and writing records
> To: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed
>
> Chris wrote:
>
>> I know how to read and write a list of records to a file using the "as
>> list" qualifier.
>> [...]
>> Does anyone have a code snippet for writing a list of records one
>> at a time and reading them back one at a time until eof?
>
> You don't. You slurp the whole list into memory and work on it there.
> (This is not to say it's impossible, just a very bad idea.)
>
> A more useful question would be: what are you trying to achieve (i.e.
> what's the script's purpose)? e.g. If you're needing a persistent,
> filesystem-based data store that allows random access, then using
> Standard Additions to read and write serialised AppleScript data
> structures is really the wrong tool for the job and there are much
> more appropriate solutions that you should look into (plain text
> files, XMLLib.osax, System Events' Plist Suite, Database Events,
> FileMaker Pro, PostgreSQL, etc.).
>
> HTH
>
> has
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden